<!--
{
  "availability" : [
    "iOS: 27.1.0 -",
    "iPadOS: 27.1.0 -",
    "macCatalyst: 27.1.0 -",
    "macOS: 27.1.0 -",
    "visionOS: 27.1.0 -",
    "watchOS: 27.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ContentMarginGuide/container",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI18ContentMarginGuideV9containerACvpZ"
  },
  "title" : "container"
}
-->

# container

The margins of the container the view is in.

```
static var container: ContentMarginGuide { get }
```

## Discussion

These margins are the default spacing to use when laying out
content in a view. The value depends on the platform, the size of
the container, and the position of the view within it.

This guide vends the system layout margins, which range from 16 to 20
points on iPhone and are larger on platforms like tvOS. On iPhone Duo,
the margin can also be asymmetric, applying different values on each
side of the device when next to a vertical bar. Apply or read the guide
instead of writing these values into your layout.

---

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)