AppSwitch

An on / off switch that applies at once (APG Switch). A real <button role="switch"> with aria-checked, so Space and Enter toggle it and screen readers say "on" or "off". The label is clickable. The thumb stretches toward its new end and settles (two caps on two springs, transform only; reduced motion jumps), and its position is the cue that does not rely on colour. Use a checkbox inside a form with a Save button; a switch is for settings that take effect immediately.

Install: pnpm add-component AppSwitch

Basic usage

Bind it with v-model. Clicking the label toggles it too. Emits change as well as update:modelValue.

Sizes

Disabled

Settings list

With the label in a row of its own, name the switch with aria-labelledby and point aria-describedby at the help text.

API