Forms

Checkbox

An interactive input that allows users to toggle a selection on or off, often used for settings or multiple-choice selections. It supports indeterminate states.

Loading...

Installation

Install the component via the CLI in one command.

npx shadcn@latest add @intentui/checkbox

Composed components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

Manual installation

Use this approach if you prefer to install and wire up the component yourself instead of using the CLI.

npm install react-aria-components @heroicons/react

Anatomy

import { Checkbox } from "@/components/ui/checkbox"
import { Description, Label } from "@/components/ui/field"
<Checkbox>
  <Label>Remember me</Label>
  <Description>Keep me logged in on this device</Description>
</Checkbox>

Examples

Invalid

The checkbox is in an error state.

Loading...

Indeterminate

The checkbox is in an indeterminate state.

Loading...

Controlled

You can control the checkbox value by using the value prop.

Loading...

Uncontrolled

You can control the checkbox value by using the defaultValue prop.

Loading...

Disabled

The checkbox is disabled.

Loading...

Component API

Checkbox

The Checkbox component is used for a single selectable option.

PropTypeDefault
classNamestring-

CheckboxGroup

The CheckboxGroup component groups related checkbox options.

PropTypeDefault
classNamestring-

CheckboxLabel

The CheckboxLabel component renders the checkbox label.

PropTypeDefault
classNamestring-

See the React Aria for the full API reference.

Unlock the full power of
Intent UI Design

Build modern web apps faster with 1000+ resources across components, blocks, patterns, templates, and starter kits.

Learn more