---
title: "init(isOn:action:label:valueLabel:)"
framework: widgetkit
role: symbol
role_heading: Initializer
path: "widgetkit/controlwidgettoggle/init(ison:action:label:valuelabel:)"
---

# init(isOn:action:label:valueLabel:)

Creates a toggle template for a control.

## Declaration

```swift
@MainActor @preconcurrency init(isOn: Bool, action: Action, @ViewBuilder label: @escaping () -> Label, @ViewBuilder valueLabel: @escaping (Bool) -> ValueLabel) where Action : SetValueIntent, Action.ValueType == Bool
```

## Parameters

- `isOn`: A boolean value that describes the current value of the toggle.
- `action`: The action the toggle performs when pressed.
- `label`: A view that renders the toggle’s label.
- `valueLabel`: A view that renders the toggle’s value. The boolean parameter represents the value.

## See Also

### Initializers

- [init(isOn:action:label:)](widgetkit/controlwidgettoggle/init(ison:action:label:).md)
- [init(_:isOn:action:valueLabel:)](widgetkit/controlwidgettoggle/init(_:ison:action:valuelabel:)-33wfq.md)
- [init(_:isOn:action:valueLabel:)](widgetkit/controlwidgettoggle/init(_:ison:action:valuelabel:)-5o6bn.md)
- [init(_:isOn:action:valueLabel:)](widgetkit/controlwidgettoggle/init(_:ison:action:valuelabel:)-4lk32.md)
