Flab UIv0.0.2
MobileA2UI

Switch

An on/off toggle for a setting that takes effect immediately. The track turns accent-green when on; the thumb position follows the data-checked state, so the DOM is the single source of truth.

States

<Switch aria-label="Off" /><Switch aria-label="On" defaultChecked /><Switch aria-label="Disabled" disabled />

With a label

<label className="flex items-center gap-3">  <Switch defaultChecked /> Auto-approve low-risk orders</label>

Props

PropTypeDefaultNotes
checked / defaultCheckedboolean—Controlled or initial state.
onCheckedChange(checked) => void—Called on toggle.
disabledboolean—Blocks interaction.
name / required——Standard form wiring.