Checkbox

An independent on-off box, with an indeterminate state.

You confirm your availability for the full duration.

<Checkbox id="project-terms" />
<Label htmlFor="project-terms">Accept project terms</Label>

indeterminate is the dash for a parent whose children are partly ticked. It is separate from checked, so the parent can be unchecked and indeterminate at the same time — which is what "some of them" means.

API

PropTypeDefault
size"default" | "sm""default"
checkedbooleanWhether the checkbox is currently ticked. To render an uncontrolled checkbox, use the defaultChecked prop instead.
classNamestring | ((state: CheckboxRootState) => string | undefined)CSS class applied to the element, or a function that returns a class based on the component's state.
defaultCheckedbooleanWhether the checkbox is initially ticked. To render a controlled checkbox, use the checked prop instead.
disabledbooleanWhether the component should ignore user interaction.
formstringIdentifies the form that owns the hidden input. Useful when the checkbox is rendered outside the form.
idstringThe id of the input element.
indeterminatebooleanWhether the checkbox is in a mixed state: neither ticked, nor unticked.
inputRefRef<HTMLInputElement>A ref to access the hidden <input> element.
namestringIdentifies the field when a form is submitted.
nativeButtonbooleanWhether the component renders a native <button> element when replacing it via the render prop. Set to true if the rendered element is a native button.
onCheckedChange((checked: boolean, eventDetails: { reason: "none"; event: Event; cancel: () => void; allowPropagation: () => void; isCanceled: boolean; isPropagationAllowed: boolean; trigger: Element | undefined; }) => void)Event handler called when the checkbox is ticked or unticked.
parentbooleanWhether the checkbox controls a group of child checkboxes. Must be used in a Checkbox Group.
readOnlybooleanWhether the user should be unable to tick or untick the checkbox.
renderComponentRenderFn<HTMLProps, CheckboxRootState> | ReactElement<unknown, string | JSXElementConstructor<any>>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
requiredbooleanWhether the user must tick the checkbox before submitting a form.
styleCSSProperties | ((state: CheckboxRootState) => CSSProperties | undefined)Style applied to the element, or a function that returns a style object based on the component's state.
uncheckedValuestringThe value submitted with the form when the checkbox is unchecked. By default, unchecked checkboxes do not submit any value, matching native checkbox behavior.
valuestringThe value of the selected checkbox.

Plus the DOM props of the element it renders. Source: checkbox/components/checkbox.tsx.