Switch

A control that toggles between on and off.

Default

The change takes effect immediately. Connect a visible Label with htmlFor and id.

Sizes

The default is 55×26. sm is the same recipe at 20px tall, for tables and dense lists.

With description

In settings rows, put the name and its consequence on the left and the switch on the right.

The agent stops speaking as soon as the caller talks.

Disabled

Best practices

When to use

  • Use for a single setting that takes effect immediately when turned on or off, such as “Record calls”.
  • Use Checkbox for additive selection or anything confirmed with a Save button, and Radio for a choice among several states.

Behavior

  • Do not pair a switch with a separate Save action; the change applies as soon as it is toggled.
  • Use the default size (55×26) in forms and settings. Use size="sm" (20px tall) in tables and dense lists.
  • In settings rows, put the name and its consequence on the left and the switch on the right.

Content

  • Name the setting, not the action: “Allow interruptions”, not “Turn on interruptions”.

Accessibility

  • Connect a visible Label with htmlFor and id, and point aria-describedby at any description.