Checkbox

A checkbox that keeps the native input for keyboard and form behaviour while drawing its own checkmark.

Props

PropTypeDefaultDescription
checkedboolean—Controlled value; omit it to run uncontrolled
defaultCheckedbooleanfalseInitial value when uncontrolled, default false
onCheckedChange(checked: boolean) => void—Called on every change, controlled or not
indeterminatebooleanfalseIndeterminate state: dash glyph plus aria-checked="mixed"
childrenReactNode—Label text, rendered to the right of the box
valuestring—The option value; determines the checked state inside a CheckboxGroup
size'sm' | 'md''md'Control size: sm / md
...restInputHTMLAttributes—Remaining props are forwarded to the native input
CheckboxGroup.valuestring[]—Controlled selection set (CheckboxGroup)
CheckboxGroup.defaultValuestring[]—Initial selection when uncontrolled (CheckboxGroup)
CheckboxGroup.onValueChange(value: string[]) => void—Called whenever the selection set changes (CheckboxGroup)
CheckboxGroup.orientation'horizontal' | 'vertical''horizontal'Layout direction, horizontal by default (CheckboxGroup)
CheckboxGroup.disabledbooleanfalseDisable every option from the group (CheckboxGroup)