<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/GroupBoxStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI13GroupBoxStyleP"
  },
  "title" : "GroupBoxStyle"
}
-->

# GroupBoxStyle

A type that specifies the appearance and interaction of all group boxes
within a view hierarchy.

```
@MainActor @preconcurrency protocol GroupBoxStyle
```

## Overview

To configure the current `GroupBoxStyle` for a view hierarchy, use the
[`groupBoxStyle(_:)`](/documentation/SwiftUI/View/groupBoxStyle(_:)) modifier.

A type conforming to this protocol inherits `@preconcurrency @MainActor`
isolation from the protocol if the conformance is included in the type’s
base declaration:

```
struct MyCustomType: Transition {
    // `@preconcurrency @MainActor` isolation by default
}
```

Isolation to the main actor is the default, but it’s not required. Declare
the conformance in an extension to opt out of main actor isolation:

```
extension MyCustomType: Transition {
    // `nonisolated` by default
}
```

## Topics

### Getting built-in group box styles

[`automatic`](/documentation/SwiftUI/GroupBoxStyle/automatic)

The default style for group box views.

### Creating custom group box styles

[`makeBody(configuration:)`](/documentation/SwiftUI/GroupBoxStyle/makeBody(configuration:))

Creates a view representing the body of a group box.

[`Configuration`](/documentation/SwiftUI/GroupBoxStyle/Configuration)

The properties of a group box instance.

[`Body`](/documentation/SwiftUI/GroupBoxStyle/Body)

A view that represents the body of a group box.

### Supporting types

[`DefaultGroupBoxStyle`](/documentation/SwiftUI/DefaultGroupBoxStyle)

The default style for group box views.

## Relationships

### Conforming Types

[`DefaultGroupBoxStyle`](/documentation/SwiftUI/DefaultGroupBoxStyle)

---

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)