Skip to content
kapable

Switch

Forms · 1 export · v0.1.0 · showcase

Native checkbox announced as an immediate on or off setting.

Browse 72 component families

Usage

Switch usage
<Switch label="Auto-deploy" name="auto" />

API

Switch API

SwitchProps is an alias of ToggleProps; the syntactic extractor reports the shared contract.

ToggleProps

Shared surface for the boolean form controls. Both host a native `<input type="checkbox">` inside a wrapping `<label>` — the browser owns keyboard behavior and form participation (works JS-off in plain forms), the kit owns the inline-label/hint wiring apps get wrong. No `error` prop by design: single toggles rarely fail validation alone, and a group of them validates at the fieldset level — wrap the group in a Field with a children function when you need the error grammar.

Toggle props
proptypenotes
labelRemixNodeVisible label text, to the control's right.
namestringForm field name.
value?stringSubmitted value when checked (browser default `"on"`).
defaultChecked?booleanInitial checked state (uncontrolled).
required?booleanMarks the control required (native `required`).
disabled?booleanDisables the control.
hint?stringAssistive hint under the label; joins `aria-describedby`.
mix?MixInputComposition passthrough for the wrapping `<label>`.

More in Forms

More in Forms