Toggle Sidebar B
AppearanceLight & dark mode D

Switch

On/off toggle. Use for binary settings where the result is immediate (no Save button needed).

Default

Bound with v-model.

Replay preview

With label

Pair with a Label for click targets.

Replay preview

With description

Add a muted description under the label to explain what the toggle controls.

Replay preview

Receive emails about new products.

Sizes

The size prop offers sm and default. For anything larger, scale with a utility class such as scale-125.

Replay preview

Disabled

Disable input.

Replay preview

Invalid

Set data-invalid on the Field and aria-invalid on the Switch, then use FieldError for the message.

Replay preview

Turn this on to receive alerts on your devices.

Choice card

Wrap each Field inside a FieldLabel to turn switches into selectable cards. The active card is highlighted automatically.

Replay preview

API Reference

Switch

PropTypeDefaultDescription
modelValuebooleanfalseChecked state. Supports v-model.
defaultValuebooleanfalseInitial state when v-model is not used.
disabledbooleanfalseDisable input.
idstringMatch with a Label for prop.
EventDescription
update:modelValueFires with the new checked state. Enables v-model.
SlotDescription
thumbOverride the sliding thumb content (e.g. an icon).

Accessibility

Keyboard shortcuts and ARIA behavior.

Shortcut Description
SpaceToggles the switch when focused.
EnterToggles the switch when focused.
TabMoves focus to or from the switch.
  • Uses role=switch with aria-checked reflecting the on/off state.
  • Pair with a label so the control's purpose is announced.