<!--
{
  "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/ControlWidgetToggle/init(isOn:action:label:valueLabel:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "WidgetKit"
    ],
    "preciseIdentifier" : "s:9WidgetKit07ControlA6ToggleV4isOn6action5label10valueLabelACyxq_q0_GSb_q0_xycq_Sbctc10AppIntents14SetValueIntentR0_Sb0N4TypeRt0_rlufc"
  },
  "title" : "init(isOn:action:label:valueLabel:)"
}
-->

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

Creates a toggle template for a control.

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

---

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)