---
title: topMargin
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/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](appkit/nstextlayoutfragment/bottommargin.md)
- [leadingPadding](appkit/nstextlayoutfragment/leadingpadding.md)
- [trailingPadding](appkit/nstextlayoutfragment/trailingpadding.md)
