Skip to content

Switch

Edit on GitHub
@volvo-cars/css v2.3.0

Switch allows the user to toggle between two different states that take immediate effect.

Switches must feature a descriptive label. Use Switches only where instant change in the user-interface based on their assigned action is intended.

Switch on and off with label

Showing Switch and On and Off with label.

Switch anatomy

Place labels to the left from the switch to make it easier for users to comprehend the meaning. Left-aligned labels will work best as they fit the way users scan the layout (in the Western culture, people read from left to right). And vice versa for the Right to Left reading audience

Switch label placement

Switch on variant

Showing switch in on state.

Switch off variant

Showing switch in off state.

The enabled state is the default state of the Switch. It is not currently being interacted with, but is available to be interacted with.

Switch in enabled state

Switch in enabled state.

The hover state is shown when the user places a cursor over the switch on non-touch devices.

Switch in hover state

Switch in hover state.

A disabled state of a button is system initiated and indicates that the button cannot be interacted with.

Switch in disabled state

Switch in disabled state.

The switch uses a neutral color scheme.

Switch in neutral color

Switch in neutral color

Switch in light mode

Switch in light mode.

Switch in dark mode

Switch in dark mode.

Switch target size

Switch uses 40px target size.

Switch example in enabled state

Switch in enabled state.

Keep in mind that Switches should only be used when the user needs to decide between two opposing states.

Write clear labels. The toggle labels should describe what the control will do when the switch is ON.

Write short and direct labels. Limit the total number of words. Label should have one or two words, preferably nouns, that describe the functionality of the toggle controls.

Avoid adding labels to describe the values of a toggle. Toggles are either OFF or ON. Adding extra text labels that describe these states (‘On’ or ‘Off’) will introduce unnecessarily clutters to the interface.