Checkbox Examples
12 checkbox compositions: labels with descriptions and subtitles, indeterminate and select-all, disabled states, vertical, horizontal and end-aligned lists, custom colors and to-do items. Each on React, Vue, Svelte and Solid, with Base UI, React Aria, Ark UI or Radix UI on React.
Every checkbox example
12 examples.
- Custom Indicator CheckboxStandardA checkbox labeled Custom green checkmark. It stays an ordinary outline until it is checked, then the box fills green.

- Disabled CheckboxStandardTwo disabled rows, Disabled unchecked and Disabled checked. One box is empty and the other is already ticked.

- Horizontal List CheckboxStandardMonday, Tuesday, Wednesday, Thursday and Friday, each with its own checkbox. The row wraps when the line runs out of room.

- Indeterminate CheckboxStandardA checkbox labeled Indeterminate state that opens on the dash, the mark for a partial selection rather than a full check.

- Nested ListStandardSelect all features sits over Analytics dashboard, Advanced reporting and Data export. The parent matches whatever subset is checked.

- Right-Aligned CheckboxStandardEmail notifications, Push notifications and SMS notifications, with each label at the start of the row and the checkbox at the end.

- Simple CheckboxStandardA single checkbox on one line with the label Accept terms and conditions, for one yes-or-no choice.

- Todo Style CheckboxStandardA checkbox labeled Complete the project documentation. Checking it strikes those words through and mutes them.

- Vertical List CheckboxStandardJavaScript, TypeScript, Python, Java and C# stacked as checkboxes, one language on each line, so any number can be picked.

- With DescriptionStandardA Marketing emails checkbox with a muted line under the label about new products, features and updates.

- With SubtitleStandardEnable notifications, with the muted word Recommended on the same line as the label and no extra sentence under it.

- With Subtitle and DescriptionStandardSecurity alerts, with a muted Recommended beside the label and a sentence under it about security updates and threats.

Or describe it. With Pro, your AI agent installs the checkbox example you describe, on your framework and UI library.
Get ProGalleries
More component examples
8 related galleries, free: open one for its live examples and their code.
Pricing
Checkbox examples MCP, with Pro
Your AI agent installs any of the 1364 examples, and every component, block and icon, with every Pro plan.
4.9/5 out of 5 · 150+ reviewsfrom 150+ founders and developers.
- Secure checkout via Stripe
- Code lives in your repo
- Keep what you've shipped if you cancel
- License terms
FAQ
Frequently asked questions
shadcn.io's Checkbox is a box people tick for a yes-or-no choice or to pick any number of options: accepting terms, choosing features, selecting rows. It is built on Base UI for React, with keyboard support, a focus ring, a checked and an indeterminate state, and controlled or uncontrolled use. Each example in this gallery is one small file built from the Checkbox and the Field parts.
Yes. Every example is free to use in personal and commercial projects, with no attribution required. Seeing the code and installing an example takes a free shadcn.io account.
A native checkbox looks different in every browser and is hard to restyle. The Checkbox draws its own box and check icon with Tailwind classes and theme tokens, so it matches the rest of the UI in light and dark mode, while Base UI keeps the checkbox role, its checked or mixed state, Space to toggle and form submission through its name.
A Checkbox for independent choices, or a single agreement, that take effect when a form is submitted. A Switch for a setting that applies the moment it changes. A Radio Group when exactly one option of several must be picked.
Derive the parent's state from its children on every render: checked when all are checked, unchecked when none are, indeterminate when some are. When the parent changes, set every child to its new value. The nested list shows the pattern, and the indeterminate checkbox shows the state on its own.
Put the checkbox in a horizontal Field and wrap the FieldLabel and a FieldDescription in FieldContent. The description is muted and smaller, and the field keeps the box level with the label's first line however far the text wraps.
Disable the checkbox and add data-disabled to its Field, so the label fades with the box. A disabled box can still be checked, for options that are included and locked. The disabled checkbox shows both states.
Set invalid on the Field: the box and label turn destructive and the checkbox is marked invalid for screen readers. Add a FieldError under it with the message, such as You must accept the terms.
Sign in with a free account, open the example and run the install command under Installation. The CLI adds the example's file to your project along with the Checkbox and Field components if you don't have them yet.
Pass the checked value and update it in the change handler; without them the box keeps its own state. Each library names these props its own way (checked and onCheckedChange, isSelected and onChange in React Aria, v-model:checked in Vue), and every example's code uses the right ones for the page you're on. The to-do checkbox holds its state so the label can react.
Add classes on the Checkbox: a size class such as size-5, and colors for the checked state behind the checked variant, like the green fill in the custom indicator. Use theme tokens so dark mode follows. To change every checkbox, edit the checkbox file in your project.
Yes. The indeterminate state shows a partial selection and exposes the checkbox as mixed to screen readers, so a select-all over a partly selected list says so.
shadcn.io's Checkbox and Field components, styled with Tailwind CSS and Lucide icons. In React the Checkbox is built on Base UI, React Aria, Ark UI or Radix UI, whichever your project uses; the Vue, Svelte and Solid versions are built on Ark UI.
Yes. Each checkbox has the checkbox role and its checked, unchecked or mixed state, Tab reaches it and Space toggles it, and the focus ring is visible. Every example labels its boxes, and clicking a label toggles its box.
Yes. They render on the server, and the checkboxes become interactive in the browser. Examples that keep state in the file are client components; in Next.js they carry the "use client" directive.
Tailwind CSS v4. The classes are standard utilities and theme tokens such as bg-primary and text-muted-foreground, read from your theme's CSS variables.
4.9 out of 5 from 150+ developers
Every checkbox example. One prompt away.
Every checkbox example is free with an account. With Pro, your AI agent installs them from a prompt.
Get Pro


















