Variants and sizes

  • Default (k-switch): one size, in a row at least 48px tall.

States

  • Off: a surface-sunken track with a 2px outline border, and a 16px outline thumb at the start.
  • On: the track fills with ink, and the thumb grows to 22px of on-ink at 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-ring ring 2px outside the track, following its pill.
  • Disabled: track border, thumb and label drop to ink at 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.