<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionLayoutItem/contentInsets",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionLayoutItem(py)contentInsets"
  },
  "title" : "contentInsets"
}
-->

# contentInsets

The amount of space added around the content of the item to adjust its final size after its position is computed.

```
var contentInsets: NSDirectionalEdgeInsets { get set }
```

## Discussion

You can use this property within a grid layout to apply even spacing around each edge of each item. Content insets are applied after applying [`edgeSpacing`](/documentation/AppKit/NSCollectionLayoutItem/edgeSpacing).

The following diagram shows the result of applying 2 points of content insets to each edge of each item in a group.

![Two diagrams that show the result of content insets applied to a group of items. The first diagram shows a group of three square items in a row, each item measuring 20 by 20 points. The second diagram shows content insets of 2 applied to each edge of each item, resulting in each item becoming 16 by 16 points. The group remains the same size.](images/com.apple.appkit/media-3570427@2x.png)

> Note:
> The value of this property is ignored for any axis that uses an estimated value for its dimension. For more information, see ``doc://com.apple.appkit/documentation/AppKit/NSCollectionLayoutDimension/estimated(_:)``.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)