---
title: "init(isOn:intent:label:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/toggle/init(ison:intent:label:)"
---

# init(isOn:intent:label:)

Creates a toggle performing an AppIntent.

## Declaration

```swift
nonisolated init<I>(isOn: Bool, intent: I, @ViewBuilder label: () -> Label) where I : AppIntent
```

## Parameters

- `isOn`: Whether the toggle is on or off.
- `intent`: The AppIntent to be performed.
- `label`: A view that describes the purpose of the toggle.

## See Also

### Creating a toggle for an App Intent

- [init(_:isOn:intent:)](swiftui/toggle/init(_:ison:intent:).md)
