<!--
{
  "availability" : [
    "iOS: 2.0.0 - 15.0.0",
    "iPadOS: 2.0.0 - 15.0.0",
    "macCatalyst: 13.1.0 - 15.0.0",
    "tvOS: 2.0.0 - 15.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIButton/contentEdgeInsets",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIButton(py)contentEdgeInsets"
  },
  "title" : "contentEdgeInsets"
}
-->

# contentEdgeInsets

The inset or outset margins for the rectangle surrounding all of the button’s content.

```
var contentEdgeInsets: UIEdgeInsets { get set }
```

## Discussion

Use this property to resize and reposition the effective drawing rectangle for the button content. The content comprises the button image and button title. You can specify a different value for each of the four insets (top, left, bottom, right). A positive value shrinks, or insets, that edge—moving it closer to the center of the button. A negative value expands, or outsets, that edge. Use the [`init(top:left:bottom:right:)`](/documentation/UIKit/UIEdgeInsets/init(top:left:bottom:right:)-1s1t9) function to construct a value for this property. The default value is [`zero`](/documentation/UIKit/UIEdgeInsets/zero).

The button uses this property to determine [`intrinsicContentSize`](/documentation/UIKit/UIView/intrinsicContentSize) and [`sizeThatFits(_:)`](/documentation/UIKit/UIView/sizeThatFits(_:)).

---

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)