---
title: topMargin
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/nstextlayoutfragment/topmargin
---

# topMargin

The amount of space reserved during paragraph layout between the top of the text layout fragment and the top of the first line in the paragraph.

## Declaration

```swift
var topMargin: CGFloat { get }
```

## See Also

### Defining margins and padding

- [bottomMargin](uikit/nstextlayoutfragment/bottommargin.md)
- [leadingPadding](uikit/nstextlayoutfragment/leadingpadding.md)
- [trailingPadding](uikit/nstextlayoutfragment/trailingpadding.md)
