Checkbox
One choice that is on or off, or stands for a set that is partly on, and takes effect when the form is saved.
Examples
States
Sends to 14 people.
Agree to the cancellation policy to book the room.
Usage
Use it when
- You turn one option on or off and the change applies when the form is saved.
- You pick any number of items from a list: filters, lists to send to, rows to act on.
- One box stands for a set of rows and must say "some" as well as "all" and "none".
Use something else when
- The setting applies the moment it flips. Use Switch instead.
- Exactly one of a few options may be chosen. Use SegmentedControl instead, or Select past 4 options.
- The on state is a filter chip in a row of chips. Use Pill instead.
- A list of rows a person selects to act on together. Use DataTable instead, with
selectionandDataTableToolbar.
Rules
General
Content
Avoid
Install
npx shadcn@latest add https://kaanarici.com/r/cobalt/checkbox.jsonimport { Checkbox } from "@/components/cobalt/ui/checkbox"