Skip to content
← Inventory

Checkbox

Renders a checkbox input with support for checked, unchecked, and indeterminate states.

Usage

import { Checkbox, CheckboxProps } from "@desk/ui/components/checkbox";

Best practices

  • A bare Checkbox has no label — pair it with a Label (htmlFor) or use CheckboxField, which wires id/htmlFor/aria-describedby for you.

  • Set the tri-state via indeterminate (sugar for checked="indeterminate"), never by passing the string "indeterminate" to checked yourself.

  • Controlled use needs checked + onCheckedChange together; passing only checked freezes the box — use defaultChecked for uncontrolled.

  • For a selectable card or a label+description row, reach for CheckboxCardGroup/CheckboxField instead of hand-laying-out around Checkbox.

Props

PropTypeDefaultDescription
indeterminateboolean | undefined

When true, displays an indeterminate state (dash icon). This is syntactic sugar for checked="indeterminate".

sizeResponsiveSize"xs"

Checkbox size — a single token or a per-breakpoint object like { base: "sm", md: "lg" }.

Also exports

  • typeCheckboxProps