Checkbox

Select multiple options from a list.

Select all

A parent checkbox turns indeterminate while only some of its children are checked. Clicking it from there checks every child.

States

Unchecked, checked, indeterminate, disabled, and a custom check color.

Usage

While indeterminate is true the box shows a minus and reports a mixed state to assistive technology, whatever checked is. Clicking it calls onCheckedChange(true).

Indicator only

CheckboxIndicator draws the box without an input. Use it inside a button, tree row, or other control that already handles the click.


Checkbox Properties

className
string

Additional CSS classes to apply to the label wrapper

children
React.ReactNode

The content to be displayed as the checkbox label

color
string

Custom color for the checkbox when checked (CSS color value)

childrenWrapperClassName
string

Custom class name for the children wrapper element

checkboxClassName
string

Custom class name for the checkbox control

disableHover
boolean

Removes all hover feedback.

Default: false

disablePadding
boolean

Removes the container padding. Hover then darkens the empty checkbox's border instead of filling a background.

Default: false

readOnly
boolean

Prevent interaction with the checkbox while preserving appearance

Default: false

indeterminate
boolean

Shows the minus and reports a mixed state, whatever checked is. Clicking it calls onCheckedChange(true).

Default: false

indeterminateIcon
React.ReactNode

Custom icon for the indeterminate state

Default: <Icon name="minus" />

selectedIcon
React.ReactNode

Custom icon for the selected state

Default: <Icon name="check" />

disabled
boolean

Set checkbox to a disabled, unclickable state

Default: false

checked
boolean'indeterminate'

The controlled checked state of the checkbox

defaultChecked
boolean'indeterminate'

The default checked state when used as an uncontrolled component

onCheckedChange
(checked: CheckedState) => void

Event handler called when the checked state changes. CheckedState is boolean or 'indeterminate'.

required
boolean

When true, indicates that the user must check the checkbox before the owning form can be submitted

name
string

The name of the checkbox, used when submitting a form

value
string

The value of the checkbox, used when submitting a form

Default: on

CheckboxIndicator Properties

checked
boolean

Shows the check mark

Default: false

indeterminate
boolean

Shows the minus mark. Wins over checked.

Default: false

disabled
boolean

Applies the same disabled treatment as Checkbox

Default: false

selectedIcon
React.ReactNode

Custom icon for the selected state

Default: <Icon name="check" />

indeterminateIcon
React.ReactNode

Custom icon for the indeterminate state

Default: <Icon name="minus" />

className
string

Additional CSS classes for the box