On this page
Props
<Checkbox>
<CheckboxControl />
<Label>Accept terms</Label>
</Checkbox>Installation
npm
pnpm
yarn
bun
npx shadcn@latest add @dotui/checkboxUsage
Use Checkbox to allow users to select multiple items from a list of individual items, or to mark one individual item as selected.
import { Checkbox, CheckboxControl } from '@/components/ui/checkbox'
import { Label } from '@/components/ui/field'<Checkbox>
<CheckboxControl />
<Label>I accept the terms and conditions</Label>
</Checkbox>Selection
Use defaultSelected for uncontrolled checkboxes, or isSelected and onChange for controlled checkboxes.
<Checkbox defaultSelected />const [isSelected, setIsSelected] = useState(false)
;<Checkbox isSelected={isSelected} onChange={setIsSelected} />Examples
Standalone
Basic
With Description
By clicking this checkbox, you agree to the terms and conditions.
Invalid
Indeterminate
Disabled
Read Only
Card
API Reference
Checkbox
A checkbox allows a user to select multiple items from a list of individual items, or to mark one individual item as selected.
| Prop | Type | Default | |
|---|---|---|---|
ReactNode | function | — | ||
boolean | — | ||
RefObject<HTMLInputElement | null> | — | ||
boolean | — | ||
boolean | — | ||
boolean | — | ||
boolean | — | ||
function | — | ||
CheckboxControl
The control element of a checkbox.
| Prop | Type | Default | |
|---|---|---|---|
ReactNode | function | — | ||
CheckboxIndicator
The visual indicator of a checkbox (the box with check/minus icon).
Supports all span attributes.
| Prop | Type | Default | |
|---|---|---|---|
Last updated on 6/16/2026