<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ControlWidgetConfigurationBuilder",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI33ControlWidgetConfigurationBuilderV"
  },
  "title" : "ControlWidgetConfigurationBuilder"
}
-->

# ControlWidgetConfigurationBuilder

A custom attribute that constructs a control widget’s body.

```
@resultBuilder struct ControlWidgetConfigurationBuilder
```

## Overview

The `@ControlWidgetConfigurationBuilder` attribute allows your control
widget’s body closure to produce a control widget configuration after zero
or more other statements:

```
struct GarageDoorOpener: ControlWidget {
    var body: some ControlWidgetConfiguration {
        let kind = "com.yourcompany.GarageDoorOpener"

        StaticControlConfiguration(
            kind: kind
        ) {
            ...
        }
    }
}
```

## Topics

### Type Methods

[`static func buildBlock<Content>(Content) -> some ControlWidgetConfiguration`](/documentation/SwiftUI/ControlWidgetConfigurationBuilder/buildBlock(_:))

Passes a single control widget configuration written as a child control
through unmodified.

[`static func buildExpression<Content>(Content) -> Content`](/documentation/SwiftUI/ControlWidgetConfigurationBuilder/buildExpression(_:))

Builds an expression within the builder.

---

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)