Capítulo 41 de 51
A two-state (no indeterminate) on/off toggle — Checkbox's simpler sibling, same <span>-by-default / nativeButton rendering tradeoff and hidden-input form participation.
Root → Thumb (the visual sliding knob).<label>, sibling label + nativeButton render={<button />}, or Field.Label.uncheckedValue: same purpose as Checkbox's — the value submitted when off, since native checkbox-like inputs submit nothing when unchecked by default.| Part | Notable props | Notable data attributes |
|---|---|---|
Root | checked/defaultChecked/onCheckedChange, value/uncheckedValue, nativeButton, name/form | data-checked, data-unchecked, plus shared field-state attributes |
Thumb | — | same as Root |
Thumb's slide transition off [data-checked]/[data-unchecked], animating transform, not left/right, for smooth performance.indeterminate.