<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/GroupBox/init(_:content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI8GroupBoxVA2A4TextVRszrlE_7contentACyAEq_G10Foundation23LocalizedStringResourceV_q_yXEtcfc::OverloadGroup"
  },
  "title" : "init(_:content:)"
}
-->

# init(_:content:)

Creates a group box with the provided view content and title.

```
@export(implementation) nonisolated init(_ titleResource: LocalizedStringResource, @ContentBuilder content: () -> Content)
```

## Parameters

`titleResource`

Text resource for the group box’s title, which
describes the content of the group box.

`content`

A [`ContentBuilder`](/documentation/SwiftUI/ContentBuilder) that produces the content for the
group box.

---

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)