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
Variants and sizes
- Default (
k-switch): one size, in a row at least 48px tall.
States
- Off: a
surface-sunkentrack with a 2pxoutlineborder, and a 16pxoutlinethumb at the start. - On: the track fills with
ink, and the thumb grows to 22px ofon-inkat the end. The state shows in shape (the thumb's size and place) and fill (an empty or a full track), not in hue, so it reads in greyscale and for people who can't tell colours apart. No green, no "On" text. - Hover: the pointer turns into a hand.
- Focus: a 2px
focus-ringring 2px outside the track, following its pill. - Disabled: track border, thumb and label drop to
inkat 38% (state-disabled-content), with the reason underneath (k-switch__reason): "Notifications for this app are off in your phone’s settings".
Do and don’t
Do
Apply the change at once.
Word the label as what is on: "Remind me about due tasks".
Say why a switch is disabled, right under it.
Don’t
Put a switch in a form with a Save button; use Checkbox.
Use a switch to start an action, like "Export now"; use Button.
Colour the track for on; the ink fill and the bigger thumb are the state.
What you provide
- Label, the on or off state, and what happens on change.
- Disabled state with its reason.