Checkbox

Checkbox lets you create a single checkbox.


Make an accessible checkbox just by specifying its name

To be perfectly honest, you won’t need anything else most of the time… so why not?

<Checkbox name="checkbox" />

Checkbox creates a label by converting name to Title Case automatically. This works for most use cases you ever need!

Contains the standard stuff you expect

Wanna add a custom label to the checkbox? Or make the checkbox checked or disabled? They’re all relatively simple:

<Checkbox name="..." label="Custom checkbox" />
<Checkbox name="..." label="Checked" checked />
<Checkbox name="..." label="Disabled checkbox" disabled />

Now the non-standard stuff — always send a checkbox’s value

Disabled checkboxes aren’t sent to the server when the form is submitted. If you want to send the checkbox’s value to the server, the easiest choice is use a hidden <input> element.

Checkbox makes this easy with a alwaysSend and readonly.

<Checkbox ... label="Always send" alwaysSend/>
<Checkbox ... label="Readonly" readonly/>

Both readonly and alwayssend send on when checked and off when unchecked

Their difference: readonly has a disabled checkbox while alwayssend doesn’t.

Bind to the checkbox easily

In Svelte, this is as simple as setting bind:checked.

<script>
let checked = false
</script>
<Checkbox ... bind:checked/>
Checkbox
Data
{
  checked: false
}

Customize your checkboxes with SVG Icons

Just set icon to use over 200,000 open source icons from the iconify project. See SVG for more information.

<Checkbox icon="ph:star-fill" name="..."/>
Starry starry checkbox 🤗