<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/EnvironmentValues/widgetContentMargins",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI17EnvironmentValuesV9WidgetKitE20widgetContentMarginsAA10EdgeInsetsVvp"
  },
  "title" : "widgetContentMargins"
}
-->

# widgetContentMargins

A property that identifies the content margins of a widget.

```
var widgetContentMargins: EdgeInsets { get }
```

## Return Value

Returns the content margins for the current widget presentation
context.

## Discussion

The content margins of a widget depend on the context in which it appears. The
system applies default content margins. However, if you disable automatic application of
default content margins with <doc://com.apple.documentation/documentation/SwiftUI/WidgetConfiguration/contentMarginsDisabled()>, the
system uses the `widgetContentMargins` property in combination with <doc://com.apple.documentation/documentation/SwiftUI/View/padding(_:)>
to selectively apply default content margins.

---

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)