Skip to main content
v1.0.0 | View in Storybook

When to use

  • To turn something on or off, like enabling notifications or toggling a setting.
  • For immediate actions where changes happen instantly and don’t require confirmation (e.g., turning on dark mode).

When to use something else

Dos and don’ts

  • Do use clear descriptive labels to explain what the Switch controls.
  • Don’t use Switches inside Menus to toggle a setting on/off (e.g., “Show grid lines”, “Show axis”). Instead, use a toggle menu item that displays a checkmark when something is on and remove the checkmark when something is off.
  • Don’t use Switches for destructive actions.

Behavior

  • Toggles immediately on interaction; state should reflect the backing setting without requiring a separate submit unless the form pattern says otherwise.
  • Do not embed Switch in Menu rows; use menu checkmark toggles per guidance above.

Often used with

Label (often inline), Helper text when the setting needs explanation; not inside Menu rows—use menu checkmarks instead.

Visual examples

The examples below are interactive and follow the doc site’s theming: light mode when the docs site is in light mode, and dark mode when you switch the docs site to dark mode.

Default checked

Use a default checked switch when the setting should start enabled—for example, notifications on by default or a commonly preferred display option.

Disabled

Use a disabled switch when the setting cannot be toggled, and explain why in helper text or a tooltip so users know what must happen before they can change it.

Controlled

Use a controlled switch when on/off state must follow application logic—for example, syncing with a parent form, feature flags, or programmatic enable and disable.

Settings form

Group switches in a settings form when users configure multiple related preferences—for example, notification types, display options, or feature toggles.

Without visible label

Use a switch without a visible label only when the purpose is clear from surrounding context, and always provide an accessible name for screen readers.

All states

Review all switch states together to ensure checked, unchecked, disabled, and focus styles remain clear and consistent across your settings UI.
Last modified on September 16, 2026