Selection
Switch
A switch turns a setting on or off the moment it is touched, with nothing to save, such as reminders for due tasks.
In kanso-ui as Switch
Accessibility
- Role and name:
<input type="checkbox" role="switch">inside its<label>; screen readers say "switch, on" or "switch, off". - Keyboard: Tab to it, Space toggles.
- Keep the label the same in both states; the switch says on or off.
- If the change fails to save, flip it back and say why in a Snackbar.
- Targets: the whole label row, at least 48px (
size-control-lg). - Contrast (light, dark): off border
outlineonpaper3.3 and 5.6:1; on trackinkonpaper16.7 and 15.9:1; on thumbon-inkonink16.7 and 15.9:1; labelinkonpaper16.7 and 15.9:1; focus ring 7.3 and 9.0:1. - Motion: the thumb slides and grows over
--k-motion-medium(300ms) on--k-ease-spring, and the track fills over--k-motion-short(150ms). With reduced motion, both change at once.