Overview
Toggle allow users to toggle between two mutually exclusive states.
When to use
Use a toggle for immediate on or off actions that apply instantly. It is best for system settings or preferences that do not require confirmation.
When not to use
Do not use a toggle for multi step actions, destructive actions, or anything that requires saving, confirmation, or additional context. Use a checkbox or button instead.
Anatomy
- Toggle
- Knob
- Knob Icon
Variants & States
States
The Toggle component has the two following states:
- Checked=true: When the toggle is in the active state.
- Checked=false: When the toggle is in the inactive state.
Accessibility
For better accessibility the Toggle component has built in icons that make it easier to convey information about the state without overlying on color alone. These icons should be always included and not hidden.
Internationalization
For RTL (right-to-left) languages there are no special adjustments made.
Accessibility
Accessibility
For better accessibility the Toggle component has built in icons that make it easier to convey information about the state without overlying on color alone. These icons should be always included and not hidden.
Properties
| Name | Type | Values | Description |
|---|---|---|---|
| checked | Boolean | truefalse |
Controls if the Toggle is displayed checked or unchecked |
| id | String | "" |
Usage Guidelines
Content Guidelines
We use toggles for binary settings that take effect immediately, such as turning a feature on or off.
Voice and tone
We sound supportive and factual, not promotional.
- We pair labels with toggles to describe what the feature does in its “on” state.
- We use verbs when the action is clearest that way, like Allow or Show.
- We use nouns when the feature itself is the focus, like Malware scanner.
- We can use subtext for extra context if the label alone is not clear.
- We keep labels short, ideally one to three words.
- We use plain language that users recognize.
- Labels do not need end punctuation.
- For labels, we use sentence case.
Accessibility
- We describe both states clearly for screen readers.
- Screen readers announce the label, control type, and current state. Depending on the platform, a toggle may be announced as a “switch,” “toggle switch,” or “toggle button.”