Agentic Design System
v3.5.0

Components · Forms · Switch

Back to Switch types

Switch

Owner: Design System Team · Version: v3.5.0

Use for instantly toggling a single setting on or off, like enabling notifications or switching to airplane mode - the change takes effect immediately, with no separate confirm step.

Properties

Size and label are properties of the same component, not separate switches - change them below to check this control's states in the Live Preview. Switches are always fully pill-shaped, so there is no corner-radius property.

Size
Required
State icons
Supporting text
Error

Live Preview

Both types compared side by side, each in all 6 states - Hover, Focused and Disabled are demonstrated on top of the Off visual, since a switch is only ever fully Off or fully On; Loading is shown On, since that's the more common case of a setting mid-save. One full matrix is rendered per selected Size.

Try it

The comparison matrix above freezes each state to demonstrate it. This instance is real: click or press Space to toggle it. "Simulate failure" makes the next toggle show Loading, then revert to its previous value and surface the error message above, instead of completing.

Simulate failure

When to use

Any single setting that takes effect immediately when flipped, with no need to confirm or submit.

Notification toggle Dark mode Feature flag Airplane mode

Validation

Switch applies instantly with no submit step, so the usual required/validate-on-submit pattern doesn't apply the way it does to Checkbox - most switches have no "wrong" state to validate.

Component Guide

Overview

Switch is for instantly toggling a single, independent setting on or off - the change takes effect immediately with no separate confirm or submit step, unlike a Checkbox inside a form that waits for the whole form to be submitted.

When to Use

  • A setting that applies the moment it's flipped - a notification toggle, dark mode.
  • A feature flag or experimental setting - turned on/off independently of any form.
  • A device-level or system-level toggle - airplane mode.

When Not to Use

  • A setting that needs explicit confirmation before it takes effect - use Checkbox plus a Save button, or a confirmation dialog for risky changes.
  • More than two states - Switch is strictly binary; use Group Button or Select for three or more options.
  • A choice that's part of a larger form submitted together - Checkbox communicates that context more clearly than an instantly-applied Switch.

Best Practices

  • Label the setting by its "on" state clearly ("Notifications", not "Enable") so the label reads correctly in both positions.
  • Reflect the change immediately in whatever the switch controls, so the user gets instant confirming feedback.
  • Avoid using Switch for anything destructive or hard to reverse without pairing it with a follow-up confirmation.

Do and Don't

Do

Dark mode

Named for the setting itself, and it applies the instant it is flipped - no Save step to hunt for.

Don't

Enable dark mode setting?Save

A Switch that only takes effect after a separate Save contradicts what a switch promises. Use a Checkbox when the change is submitted with a form.

Accessibility

  • Exposed with a real switch or checkbox role, with the current state (on/off) announced to assistive technology.
  • The label describes the setting itself, not the mechanism ("Dark mode", not "Toggle switch").
  • On/off is never communicated by color alone - the thumb's position and track fill both change too.

Related Components

Checkbox, Radio, Group Button.