Switch
Turns a setting on or off, with immediate effect.
01Anatomy
5 parts. Select a number or a name to see what each part does.
01 · Label
Names the setting, not the action. It doesn’t change with the state.
- Required
- Yes
- Recommended
- “Notifications”, not “Turn notifications on”.
02 · Description
A second line: what changes when it is on.
- Required
- No
03 · Track
The rail that shows on or off through fill and position.
- Required
- Yes
04 · Thumb
The knob. Its position is the state: right means on, in left to right languages.
- Required
- Yes
05 · State icon
A tick or a cross in the thumb, so the state doesn’t depend on colour.
- Required
- No
Example spacing, measured on this drawing (16 px = 1 em). A common implementation, not a rule: values change from system to system. W and H are width and height, as in Figma: Hug follows the content, Fill takes the space of the parent. The green square is the touch target: 44 × 44 px, even when the control looks smaller. That is WCAG 2.5.5 (level AAA) and Apple’s minimum; Material uses 48 dp; the WCAG AA minimum is 24 × 24 px (2.5.8).
Spacing is measured on the normal view: switch back to Normal to show it.
02Structure
- Switchcomponent setauto layouthorizontal
- Textauto layoutvertical
- Labeltext
- Descriptiontextboolean
- Controlframe52 × 32
- Trackrectangleradius full
- Thumbellipse
- Iconinstanceboolean
| Property | Type | Values |
|---|---|---|
| On | Boolean | truefalse |
| State | Variant | DefaultHoverFocusDisabled |
| Size | Variant | SmallMedium |
| Label position | Variant | LeadingTrailing |
| Icon | Boolean | truefalse |
Put the thumb in auto layout with the track and switch alignment from left to right for On: smart animate does the slide.
03States
Some systems add a brief loading state while the change is saved. Varies by design system.
04Variants
There is no single correct anatomy: names, variants and properties differ from one design system to another. These are common structural models distilled from established design systems and accessibility guidance.
Proven methods for designing interfaces with AI. Every two weeks, in Italian.
Subscribe