> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Switch

> A Switch toggles a setting on or off. It represents a binary state and should update immediately when toggled. Switches are typically used for system or feature controls that take effect right away.

## Switch

<Badge color="blue">v1.0.0</Badge> | [View in Storybook](https://master--695bb4b1b8041ae09768950a.chromatic.com/?path=/docs/primitives-switch--docs)

### 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

* Deferred or form-bound changes: use [Checkbox](/aura-design-system/primitives/checkbox) or explicit [Button](/aura-design-system/primitives/button) submit.
* One-shot actions (delete, submit): use [Button](/aura-design-system/primitives/button).
* Several related on/off settings: use [Toggle group](/aura-design-system/primitives/toggle-group), [Checkbox](/aura-design-system/primitives/checkbox), or [Select](/aura-design-system/primitives/select)—not a single [Switch](/aura-design-system/primitives/switch) per unrelated setting.

### Dos and don'ts

* 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.
* Do use clear descriptive labels to explain what the Switch controls.
* 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](/aura-design-system/primitives/switch) in [Menu](/aura-design-system/primitives/menu) rows; use menu checkmark toggles per guidance above.

### Often used with

* [Label](/aura-design-system/primitives/label) (often inline), [Helper text](/aura-design-system/primitives/helper-text) when the setting needs explanation; not inside [Menu](/aura-design-system/primitives/menu) rows—use menu checkmarks instead.
