Switch

v2.1

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

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

Anatomy

Properties

Label

Switches should always have a label associated with them. The label should clearly indicate what is being activated.

An unselected switch with a label.

Selected

Switches appear as either selected (on) or unselected (off). Switches cannot be in an indefinite state.

An unselected switch sits above a selected switch.

Disabled

Switches can be disabled in either a selected or unselected state if there is a prerequisite to altering its state.

A disabled unselected switch sits above a disabled selected switch.

Behavior

Immediate

Switches immediately update the state of the application when their state changes. If a delay is necessary, a loading indicator should be used to inform the user that the process is taking longer.

A ‘Face ID sign in’ selected switch sits in the security section of the eBay app.

Labels

Avoid using the words “on” or “off” within the label. Switches imply an on/off state so including it in the label is redundant.

It is okay to use labels with verbs that clarify the decision if it isn’t a clear on/off decision, like “Show” or “Notify”.

3 switches with labels: ‘Auto-detect country’ with an unselected switch, ‘Show new layout’ with a selected switch, and ‘Notify me when I receive an offer’ with a selected switch.

Platforms

Platform-specific

Native platforms use the operating system’s default visual treatment. The behavior and options remain the same across platforms.

Web, Android, and iOS switches are shown with examples of their selected and unselected states.

Best practices

Specs

A switch component is shown with specs highlighted. Space between the Label and Switch is 16px, and height of Switch is 24px.