<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WidgetKit",
  "identifier" : "/documentation/WidgetKit/ControlWidgetButton/init(action:label:actionLabel:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "WidgetKit"
    ],
    "preciseIdentifier" : "s:9WidgetKit07ControlA6ButtonV6action5label0E5LabelACyxq_q0_Gq0__xycq_Sbctc10AppIntents0H6IntentR0_rlufc"
  },
  "title" : "init(action:label:actionLabel:)"
}
-->

# init(action:label:actionLabel:)

Creates a button template for a control.

```
@MainActor @preconcurrency init(action: Action, @ViewBuilder label: @escaping () -> Label, @ViewBuilder actionLabel: @escaping (Bool) -> ActionLabel) where Action : AppIntent
```

## Parameters

`action`

The action your button performs when pressed.

`label`

A view that renders the button.

`actionLabel`

A view that is rendered when the button’s action is performed

## Discussion

Use the action label to additionally customize the appearance of this
control button while its action is performed

```
ControlWidgetButton(action: OpenTrunkIntent()) {
    Label("Open Trunk", systemImage: "car.side.rear.open.crop")
} actionLabel: { isActive in
    if isActive {
        Text("Opening…")
    }
}
```

The example above produces a control button that
appears in Control Center with “Open Trunk” as its title and the provided SF symbol.
While the control is performing its action, it shows the
“Opening…” subtitle.

---

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)