<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/GlassEffectContainer/init(spacing:content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI20GlassEffectContainerV7spacing7contentACyxG14CoreFoundation7CGFloatVSg_xyXEtcfc"
  },
  "title" : "init(spacing:content:)"
}
-->

# init(spacing:content:)

Creates a glass effect container with the provided
spacing, extracting glass shapes from the
provided content.

```
@MainActor @preconcurrency init(spacing: CGFloat? = nil, @ContentBuilder content: () -> Content)
```

---

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)