One Logo Pool Ball
SwiftUI · IOS API REFERENCE

GroupBox

struct · iOS 14.0+ · SDK 27.1

nonisolated struct GroupBox<Label, Content> where Label : View, Content : View

A stylized view, with an optional label, that visually collects a logical grouping of content. Use a group box when you want to visually distinguish a portion of your user interface with an optional title for the boxed content. The following example sets up a `GroupBox` with the label "End-User Agreement", and a long `agreementText` string in a ``SwiftUI/Text`` view wrapped by a ``SwiftUI/ScrollView``. The box also contains a ``SwiftUI/Toggle`` for the user to interact with after reading the text. var body: some View { GroupBox(label: Label("End-User Agreement", systemImage: "building.columns") ) { ScrollView(.vertical, showsIndicators: true) { Text(agreementText) .font(.footnote) } .frame(height: 100) Toggle(isOn: $userAgreed) { Text("I agree to the above terms") } } } ![An iOS status bar above a gray rounded rectangle region marking the bounds of the group box. At the top of the region, the title End-User Agreement in a large bold font with an icon of a building with columns. Below this, a scroll view with six lines of text visible. At the bottom of the gray group box region, a toggle switch with the label I agree to the above terms.](SwiftUI-GroupBox-EULA.png)

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

7 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

GroupBox.init(content:label:)

callback cannot propagate synchronous failure

GroupBox.body

This protocol needs associated types that cannot yet cross the bridge.

GroupBox.init(content:)

callback cannot propagate synchronous failure

GroupBox.init(_:content:)

callback cannot propagate synchronous failure

GroupBox.init(_:content:)

callback cannot propagate synchronous failure

GroupBox.init(_:content:)

callback cannot propagate synchronous failure

GroupBox.init(label:content:)

callback cannot propagate synchronous failure

All SwiftUI types →