Toggles and Switches
Toggles can take one of three forms: text-based toggles, icon-based toggles or switches.
Text Toggle Example
When to Use
- Use a text toggle when an icon does not provide an adequate understanding of each option. For example, a text toggle should be used for switching between light and dark interfaces.
Variations
- Text Toggle Example (shown above)
- Icon Toggle Example
- Switches Example
Variations
Icon Toggle Example
When to Use
- Use icon toggles to conserve space, under the condition that the two ideas are clearly presented to the user. An example of this would be “Locked” (icon of padlock) and “Unlocked” (icon of open padlock). Icon imagery within toggles should not change the subject matter.
Switches
A switch provides a definitive on or off state. The option that the switch controls, as well as the state it’s in, should be made clear either with a text label or icon.
When to Use
- Use switches sparingly within desktop applications. They are a common mechanism within mobile design for turning settings on or off.
Developer Notes
Order Matters: For all toggles, the <input>
element must be the first item inside of the toggle container. Otherwise the disabled
state will not work properly.