Docs
Components/Primitives/Toggle

Toggle

A styled switch control with an optional label.

s0 add toggle

Usage

@State private var isOn = false

S0.Toggle("Airplane Mode", isOn: $isOn)
S0.Toggle(isOn: $isEnabled)

Parameters

NameTypeDefaultDescription
labelString?nilOptional text label displayed next to the switch.
isOnBinding<Bool>Binding to the toggle state.