Use when
- A single setting, feature, preference, or hardware-like control has two clear states.
- The setting can take effect immediately or can clearly show a short pending state.
- The change is reversible and low risk.
Present one stable label with a binary switch state, immediate reversible application, visible state text when helpful, and explicit pending, unavailable, disabled, or read-only states when the setting cannot simply flip.
Users need to turn one setting, feature, preference, or hardware-like option on or off and understand whether the change has taken effect.
The controlled item has clear on/off logic and the label can describe the same object in both states.
Present one stable label with a binary switch state, immediate reversible application, visible state text when helpful, and explicit pending, unavailable, disabled, or read-only states when the setting cannot simply flip.
Off state.
The switch looks on while the service is still offline.
Use role switch with aria-checked or a native checkbox implementation that exposes the checked state.
Turn a setting on and off, inspect immediate applied state, delayed pending state, disabled dependency, and compare against switches misused for destructive actions or multi-option choices.
Launch the live UI/UX lab when you want to inspect states, keyboard behavior, and common failure modes.
Off state.
Tab moves focus to the switch when it is interactive.
Using a switch to delete, publish, pay, submit, or trigger another one-time command.
W3C Web Accessibility Initiative - checked
APG switch guidance defines binary on/off semantics, stable labels, accessible names, aria-checked state, and keyboard toggling expectations.
IBM Carbon Design System - checked
Carbon toggle guidance supports immediate reversible binary setting changes and documents on, off, focus, disabled, read-only, skeleton, label, state text, and click target behavior.
GNOME - checked
GNOME switch guidance limits switches to clear on/off features, settings, or hardware and documents delayed effect and unavailable-state handling.
Last verified: