Home Components Checkbox
React Checkbox Components
16 free React checkboxes built with Tailwind CSS and shadcn/ui conventions. Copy the code or install with the shadcn CLI. Great for forms, task lists, and indeterminate states.
Checkbox 1 : Basic checkbox with a sky blue checked state and a clickable label beside it.Checkbox 2 : Checkbox that starts in an indeterminate state with a minus sign, plus a label and helper text.Checkbox 3 : Checkbox with a dashed border that fills sky blue when checked.Checkbox 4 : To-do style checkbox that strikes through and greys out its label when checked.Checkbox 5 : Three checkboxes side by side in default, medium and large sizes.Checkbox 6 : Selectable chip checkboxes for snack options, where the tick only appears inside selected chips.Checkbox 7 : Checkbox with a bold label and a smaller terms description underneath it.Checkbox 8 : Horizontal group of checkboxes under a Team roles heading for picking several options.Checkbox 9 : Vertical checkbox list of focus areas with an icon next to each option label.Checkbox 10 : Three slightly larger checkboxes in red, sky blue and green for destructive, info and success.Checkbox 11 : Icon checkboxes using triangle, diamond and hexagon shapes that fill with colour when checked.Checkbox 12 : Round coloured checkboxes in red, blue and green that show a white circle check when ticked.Checkbox 13 : Settings option cards with a checkbox, label and description that tint blue when selected.Checkbox 14 : Bordered list of skills with an icon and label on the left and a checkbox on the right.Checkbox 15 : Parent and child checkbox tree where Select all shows an indeterminate state for partial picks.Checkbox 16 : Consent checkbox with a description and Reset and Continue buttons, Continue disabled until checked.
About React Checkbox Components A React checkbox lets users turn an option on or off, or pick several options from a list. Most Watermelon UI checkboxes are built on the Radix UI Checkbox primitive with Tailwind CSS, and a few use Base UI, so they are keyboard accessible and support an indeterminate state. Add one with the shadcn CLI, then pair it with a Label and wire checked and onCheckedChange.
When to use it Accepting terms or opting in to emails on a form. Selecting rows in a table, with a select-all checkbox in the header. Filter lists where several options can be active at once. When to use something else Use Switch when the setting takes effect immediately, like a preference toggle. Use Radio Group when only one option in the set can be chosen. Use Select when the list is long and should stay collapsed until opened. Frequently asked questions How do I make a shadcn checkbox checked by default? Pass defaultChecked for an uncontrolled checkbox, or checked with onCheckedChange to control it from state. Use one approach, not both.
How do I show an indeterminate checkbox? With the Radix-based checkbox, set checked="indeterminate". It is the usual state for a select-all box when only some rows are selected.
How do I use a shadcn checkbox with react-hook-form? Render it inside a Controller and map field.value to checked and field.onChange to onCheckedChange. A plain register call does not work because the Radix checkbox is a button, not a native input.
Why does onChange not work on a shadcn checkbox? The Radix checkbox is a button, so use onCheckedChange instead of onChange. It receives true, false, or "indeterminate", so store checked === true if your state is a plain boolean.
How to use React Checkbox Components Start from a React project with Tailwind CSS and shadcn/ui set up. Next.js, Vite, Remix, and Astro all work. Run npx shadcn@latest add https://registry.watermelon.sh/r/checkbox-1.json to add the source files to your project. Import it where you need it, then edit the Tailwind classes and design tokens to match your product. Dependencies installed with it: @base-ui/react, lucide-react.
The code is yours: it lives in your repository, so there is no runtime package to keep updated. Watermelon UI is free and open source under the MIT license.
More: Free React components , UI library alternatives , guides .