Getting started
Components
"Users expect the same immediate results from a digital toggle as they do from their real-world counterparts (e.g., light switches). Immediate results are a facet of toggle switches that grants users the freedom and control to update their preferences as needed."
— Nielsen Norman Group, Toggle-Switch Guidelines
legend
role="switch"
required
A Switch is always displayed with a visible label. The label text should never change based on the state of the Switch.
In cases where the Switch requires additional context, you can display this information as help text below the Switch and label.
When a Switch is required to be 'on', a required indicator should be displayed alongside the label.
Use a disabled Switch to indicate to users that it is not interactive.
Multiple Switches and their labels are grouped together with a common group component.
The default Switch state is off.
Use the disabled on Switch to indicate to users that it is not interactive and cannot be turned off.
Switch label text should indicate what the Switch does when it is on, but should not describe the state itself ("enabled", "disabled"). Label text shouldn't change when the state of the Switch changes.
Switch labels should be concise and put the most important information in the first few words. Avoid making the label a question.
Use Help Text for additional information, like any notable implications of turning on the Switch.
Help us improve this component by providing feedback, asking questions on Slack, or updating this file on GitHub.