Components / Inputs

Switch nativelite

A labelled on/off switch; bind checked.

Children
none
Loading the renderer…
Switch rendered by the React renderer on Web
Web React
Switch rendered by the SwiftUI renderer on iOS
iOS SwiftUI
Switch rendered by the Compose renderer on Android
Android Compose
Switch rendered by the gpui renderer on Desktop
Desktop gpui

View exponential-ui-switch, painted by each native renderer.

disabled
PropTypeDefaultDescription
labelrequiredbindstring–The text beside the switch.
namerequiredstring–The field's key in the submitted data.
checkedbindbooleanfalseThe state; bind it.
descriptionstring–A muted line under the label.
disabledbooleanfalseShows it inert.
NameKind
on.changeevent: runs an action
Role
switch
Semantics
switch; the label (and description) first, the switch at the end; the whole row toggles
KeysAction
SpaceEntertoggle
Recipe parts
Switch/rootSwitch/trackSwitch/thumbSwitch/labelSwitch/descriptionSwitch/body
Keyed by
checkeddisabled:hover:pressed:focus:disabled:checked:open:selected:invalid:dragover

Themes · Write a theme

Toggle row

Label, an optional 12px description at 50%, and a 36×20 switch: on is the primary track with a primary-foreground thumb, off the active fill.

Switch

The 36×20 capsule that flips a setting the moment it is pressed — there is no Save beside one.

More

Off is the active fill under the foreground knob, on the primary fill under the primary-foreground knob, and the travel is one fast duration. It almost always rides a toggle ROW, which owns the label and the description; this is the bare control.

iOSok
GlassToggleStyleapps/ios/ExpUI/Sources/GlassControls.swift

applied app-wide as .toggleStyle(.glass), so call sites keep the stock Toggle

Androidok
glassSwitchColors()apps/android/app/src/main/java/com/exponential/app/ui/components/SheetOptionRows.kt

the tokens for the stock M3 Switch; there is no GlassSwitch composable

Desktopok
controls::buttons::web_switchapps/desktop/crates/exponential-ui-gpui/src/controls/buttons.rs

a lint (only_controls_constructs_switches) refuses Switch::new anywhere else