Toggle Sidebar B
header.lightDarkMode D

Switch

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

Default

Bound with v-model.

With label

Pair with a Label for click targets.

Disabled

Disable input.

API Reference

Props, events, and slots for each sub-component.

Switch

Props

PropTypeDefaultDescription
modelValuebooleanfalseChecked state. Supports v-model.
defaultValuebooleanfalseInitial state when v-model is not used.
disabledbooleanfalseDisable input.
idstringMatch with a Label for prop.

Events

EventDescription
update:modelValueFires with the new checked state. Enables v-model.

Slots

SlotDescription
thumbOverride the sliding thumb content (e.g. an icon).

Accessibility

Keyboard shortcuts and ARIA behavior.

Keyboard

ShortcutDescription
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.