Checkbox

Requires JS

A toggle that allows users to choose between checked and unchecked states.

Usage

import { Checkbox } from "#/ui/components/Checkbox"
<Checkbox />

Label

You can pass a label to your checkbox to automatically associate it with the checkbox.

If you need a checkbox with accessible text that isn’t visible, you can hide the label

Optionally, if you need your label separated from your checkbox, you can associate them by using the id and htmlFor props.

Size

You can change the size of your checkbox by passing the size prop.

Icon

You can pass a custom icon if you want to change the default check

You may need to adjust the size of your icon to fit the checkbox (this isn’t done for you for custom icons)

Controlled

You can control the state of the checkbox from outside of the component by passing the checked and onChange props.

Indeterminate

While a checkbox can only accept 2 states in a form, checked or unchecked, there may be other situations where showing an indeterminate (or partially selected) state might make sense.

Customisation

If you’d like to extend the checkbox to make a larger clickable area, you can use the CheckboxCard component.

See more at CheckboxCard