Switch

Switches give organisers control over a feature or option that can be switched on or off.

View in Storybook

Anatomy

A switch can be standalone element to sit next to additional text or work within certain components.

Anatomy
  1. Switch: Signifies whether an item has been toggled on or off by the consumer.
  2. Label (optional): Title of an item that can be selected.
  3. Help Text (optional): An additonal text description to help explain the purpose of the switch.

 


States

Switch has off, on, and disabled states. Should there be any time lag between turning a switch on or off, a loading spinner becomes visible.

Interact with each switch to reveal on and off states.

Sizes

We support 2 sizes of our switch - Small, Default and Large. The size of the switch is determined on its placement. Our default size is used when nested within a component such as a Card or ListItem. Larger switches are independent or when placed outside contained spaces.

 


Usage

The Switch's purpose is to make a simple on/off choice that takes immediate effect. If you need multiple selections or have only one option, use Checkbox.

With label

 

Switches that display additional labels and descriptions are typically used separately and not nested within larger components.

 

Together with other components

 

When a switch is nested within a component, it is always fixed to the right hand edge of the component's container.

 

Switch also conforms to whatever the main component's alignment is.

Footer trigger

 

In Dropdown menus, a switch can toggle on hidden list items. This is always placed inside the Footer of the menu and is always our Small size.

 


 

Best practice

Switch has a single purpose across the product which makes it different from other selectable components;

 

  • Avoid long descriptions that sit alongside Switch. This is to avoid the use of truncation.
  • Communicate why a switch is disabled and how to enable it if possible in the description text.
  • When the selection takes immediate effect.

 

Do's and Don'ts

Do

Don't

✅ Use when an item needs to be turned on or off.

🚫 Use to select more than one option from a list. Use Checkbox instead.

✅ Use when there is only one option in a list to select

🚫 Use when there is only one option in a list to select. Use Radio instead.

 

Also see