Checkbox
A checkbox built on a native input, so keyboard and form behaviour come for free. The check draws in on an ease-out curve.
Examples
Basic
Show code
<Checkbox label="Accept the terms" bind:checked={terms} />Indeterminate
Show code
<Checkbox label="Select all" bind:checked={all} bind:indeterminate={mixed} />Disabled
Show code
<Checkbox label="Unavailable" disabled />Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | false | Checked state. Bind it with bind:checked. |
label | string | — | Visible label text beside the box. |
indeterminate | boolean | false | Shows the mixed dash and sets the native mixed state. Bind it; the browser clears it on activation. |
Any other attribute is spread onto the underlying checkbox input.