---
title: "init(action:label:actionLabel:)"
framework: widgetkit
role: symbol
role_heading: Initializer
path: "widgetkit/controlwidgetbutton/init(action:label:actionlabel:)"
---

# init(action:label:actionLabel:)

Creates a button template for a control.

## Declaration

```swift
@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

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.

## See Also

### Initializers

- [init(action:label:)](widgetkit/controlwidgetbutton/init(action:label:)-77p8j.md)
- [init(action:label:)](widgetkit/controlwidgetbutton/init(action:label:)-8oxxp.md)
- [init(_:action:actionLabel:)](widgetkit/controlwidgetbutton/init(_:action:actionlabel:)-4sgji.md)
- [init(_:action:actionLabel:)](widgetkit/controlwidgetbutton/init(_:action:actionlabel:)-67uvw.md)
