Skip to main content

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

In progress | Storybook link coming soon

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

  • 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 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.
Last modified on May 11, 2026