A control that allows the user to toggle between checked and unchecked. Built on Base UI Checkbox primitives.
import {
CheckboxRoot,
CheckboxIndicator,
CheckboxLabel,
} from "@/components/ui/static/checkbox"<div className="flex items-center gap-2">
<CheckboxRoot id="my-checkbox">
<CheckboxIndicator />
</CheckboxRoot>
<CheckboxLabel htmlFor="my-checkbox">
Label text
</CheckboxLabel>
</div>checkedbooleanControlled checked state.
onCheckedChange(checked: boolean) => voidCallback when checked state changes.
defaultCheckedbooleanDefault checked state for uncontrolled usage.
indeterminatebooleanWhether the checkbox is in indeterminate state.
disabledbooleanWhether the checkbox is disabled.