Skip to main content

Checkbox

Checkboxes allow users to select multiple items from a list of individual items, or to mark one individual item as selected.

On this page
Props
<Checkbox>
  <CheckboxControl />
  <Label>Accept terms</Label>
</Checkbox>

Installation

npx shadcn@latest add @dotui/checkbox

Usage

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.

PropType
ReactNode | function
boolean
RefObject<HTMLInputElement | null>
boolean
boolean
boolean
boolean
function

CheckboxControl

The control element of a checkbox.

PropType
ReactNode | function

CheckboxIndicator

The visual indicator of a checkbox (the box with check/minus icon).

Supports all span attributes.

PropType

Last updated on 6/16/2026