Playground
Every control sets a real prop of SwitchProps. The JSX below updates as you go.
Web
iOS
Android
JSX · SwitchProps
Variants
5 examples from src/atoms/switch/switch.md, each rendered live from its own JSX.
Sizes
States
Hover, focus and press are pinned so they can be compared side by side; the rest are real props.
Anatomy
1
Track
2
Thumb
3
Label
4
Description
Dimmed parts appear only in some states or variants.
Props
16 props on SwitchProps, grouped as they are declared in source. Required props are marked *.
Accessibility and keyboard
Keyboard
Space
Toggles
Tab
Moves focus on
Semantics
Roles
switch
States
checked
disabled
ARIA on web
aria-checked
aria-label
Below the platform minimum, the touch area grows to 44 pt on iOS and 48 dp on Android without moving the layout.
From the docs
Pass ref to access the interactive switch row, including its label. Use useRef<ComponentRef<typeof Switch>>(null) from React, or useRef<View>(null) with React Native's View type. Object and callback refs are supported and detach on unmount. Calling ref.current?.focus() or .blur() delegates to the host without activating the control. Browser focus is supported; native focus depends on the platform and React Native version, and is separate from accessibility focus.
On the web, Space activates the focused control on key release, and Enter also activates it. Holding Space does not repeat the change. Moving focus away, disabling the control, or composing text cancels a pending Space press.
Platform skins
The playground's props on each platform: same tree, native shapes, type and touch sizes.
Usage
In glass mode a switch keeps its solid look on every platform: it is a small mark inside content, not a surface, so its track and knob draw as in solid mode, with no pane and no rim, a checked track in its solid brand fill. The track, the label, the description and the hit target never move, and the checked state flips at once. A disabled switch is inert.
small and large scale the track on the web. Pass chip for a compact toolbar setting: a 32 px bordered capsule with a 26×16 track, a 10 px knob and the label after the switch. The web thumb follows the reference spring and Reduce Motion; native skins keep their own switch. On iOS and Android the switch is the platform's own control, which comes in one size (51x31 on iOS, 52x32 on Android), so the size props leave it unchanged there.
Pass ref to access the interactive switch row, including its label. Use useRef<ComponentRef<typeof Switch>>(null) from React, or useRef<View>(null) with React Native's View type. Object and callback refs are supported and detach on unmount. Calling ref.current?.focus() or .blur() delegates to the host without activating the control. Browser focus is supported; native focus depends on the platform and React Native version, and is separate from accessibility focus.
Tokens
Read from the playground render. Values follow the scheme and the ion hue.
--fd
--ft
--ion
--tx3