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
modelValue(boolean): On or off (use v-model).label(string): Visible name, beside the switch. Without one, pass aria-label or aria-labelledby; extra attributes reach the button.description(string): A line under the label, linked to the switch with aria-describedby.size('sm' | 'md' | 'lg'): Track size. Every size has a 44px hit area.disabled(boolean): Disables the switch and dims the row.