Skip to content

Checkbox

Form

Boolean toggle with checkmark indicator. Supports indeterminate state.

ControlledIndeterminateDisabled
Open preview

Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.

Usage

Use checkboxes for independent choices. Radix can return true, false, or indeterminate; normalize that value when storing a boolean.

Import
import { Checkbox } from "@dashboardpack/core/components/ui/checkbox";

Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.

API reference

Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.

Checkbox props
PropType / DefaultDescription
checkedboolean | "indeterminate"

Default: —

Controlled selection state.
defaultCheckedboolean

Default: —

Initial uncontrolled state.
onCheckedChange(checked: boolean | "indeterminate") => void

Default: —

Handle selection changes.
disabledboolean

Default: false

Prevent changes.

Build with these too