Switch

v2.1

Switches provide a binary on/off choice. Their input is immediate and requires no additional action.

  • CSS
  • Marko
  • React
Stylized artwork of two switches with labels.

Anatomy

Properties

Behavior

Platforms

Best practices

Labels

Do use clear and concise labels.

‘Facial ID sign in’ selected switch

Avoid using action-related verbs with “on” or “off” when adding labels to controls. Switches imply an on/off state so including it in the label is redundant.

‘Turn on Facial ID sign in’ selected switch

Placement

Do use switches as trailing elements.

‘Auto-detect’ selected switch with the switch to the right.

Don’t use switches as leading elements.

‘Auto-detect’ selected switch with the switch to the left.

Do ensure switches are either aligned with the grid or with each other when multiple switches are stacked.

Three stacked switches with labels aligned to the left and switches aligned to the right.

Don’t misalign switches by placing them immediately after labels when multiple switches are stacked, as this can affect legibility.

Three stacked switches with labels aligned ot the left and switches aligned right after each label, creating a staggered effect.

Checkbox or switch

If the action is part of a larger form, use a checkbox instead. The items will be submitted with the rest of the form details.

Three checkboxes with distinct labels, one unselected and two selected, are stacked in a list.

Switches apply changes immediately and don’t require the user to submit anything. If you need to include the data in form content, use a checkbox set.

Three switches with distinct labels, one unselected and two selected, are stacked in a list.

Radio button or switch

Switches are used for activation, not selection. If you are selecting between two available options, use a radio set instead.

A ‘List view’ selected radio button sits above a ‘Grid view’ unselected radio button.

Switches should not be used to choose between opposing or discrete options. Instead, use switches for on/off situations.

An unselected switch with two labels, ‘List view’ on the left, and ‘Grid view’ on the right.

Specs