<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ControlGroup/init(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI12ControlGroupVA2A0cD18StyleConfigurationV7ContentVRszrlEyACyAGGAEcfc"
  },
  "title" : "init(_:)"
}
-->

# init(_:)

Creates a control group based on a style configuration.

```
nonisolated init(_ configuration: ControlGroupStyleConfiguration)
```

## Discussion

Use this initializer within the
[`makeBody(configuration:)`](/documentation/SwiftUI/ControlGroupStyle/makeBody(configuration:)) method of a
[`ControlGroupStyle`](/documentation/SwiftUI/ControlGroupStyle) instance to create an instance of the control group
being styled. This is useful for custom control group styles that modify
the current control group style.

For example, the following code creates a new, custom style that places a
red border around the current control group:

```
struct RedBorderControlGroupStyle: ControlGroupStyle {
    func makeBody(configuration: Configuration) -> some View {
        ControlGroup(configuration)
            .border(Color.red)
    }
}
```

---

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)