Docs Components
Switchexperimental
On or off, right now. Flipping a switch takes effect immediately, no Save required. If the change needs saving first, it should be a checkbox.
States
off— Sunken track, ink knob at left.on— Inverse ink track, paper knob slides right.track: color-bg-inverseknob: color-text-inversedisabled— 45% opacity, not-allowed cursor.
API
| Prop | Type | Description |
|---|---|---|
checked required | boolean | Controlled state. |
onCheckedChange required | function | Receives the next boolean. |
label | string | Visible row label; SHOULD state the current effect (Active / Inactive). |
Accessibility
Space— Toggles the switch.Enter— Toggles the switch (native button behavior).
Guidelines
- mustSwitch changes take effect immediately — never pair a Switch with a Save button for the same value.
- shouldIf the change is destructive or hard to reverse, use a Checkbox + explicit submit instead.