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

# ContentMarginGuide

A guide for resolving the content margins for a view.

```
struct ContentMarginGuide
```

## Overview

Apply a guide to a view with the
[`contentMargins(for:edges:alignment:)`](/documentation/SwiftUI/View/contentMargins(for:edges:alignment:)) modifier, or read its
value from a [`GeometryProxy`](/documentation/SwiftUI/GeometryProxy). SwiftUI provides
[`container`](/documentation/SwiftUI/ContentMarginGuide/container).

## Topics

### Getting the container

[`static var container: ContentMarginGuide`](/documentation/SwiftUI/ContentMarginGuide/container)

The margins of the container the view is in.



---

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)