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

PropTypeDefaultDescription
checkedbooleanfalseChecked state. Bind it with bind:checked.
labelstring—Visible label text beside the box.
indeterminatebooleanfalseShows 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.