Skip to content

CheckboxInput

A checkbox input with label, description, and validation support.

<CheckboxInput label="Accept terms" value={false} />
<CheckboxInput label="Accept terms" value />
<CheckboxInput label="Accept terms" value="indeterminate" />
Receive weekly product updates and announcements.
<CheckboxInput
label="Subscribe to newsletter"
value={false}
description="Receive weekly product updates and announcements."
/>
function CheckboxStory(args: CheckboxInputProps): React.JSX.Element {
const [value, setValue] = useState(args.value);
return (
<CheckboxInput
{...args}
onChange={checked => setValue(checked)}
value={value}
/>
);
}
<div
className={css({
display: 'flex',
flexDirection: 'column',
gap: '4',
})}>
<CheckboxStory {...args} isDisabled={false} />
<CheckboxStory {...args} isDisabled />
</div>
<CheckboxInput label="Accept terms" value={false} padding={2} />
<CheckboxInput
label={( <> I agree to the <Link href="/terms">terms and conditions</Link> </> )}
value={false}
/>
<CheckboxInput label="Accept terms" value={false} size="sm" />
<CheckboxInput label="Accept terms" value={false} size="lg" />
<CheckboxInput label="Accept terms" value isDisabled />
<CheckboxInput label="Accept terms" value isReadOnly />
<CheckboxInput label="Accept terms" value isLoading />
<CheckboxInput label="Accept terms" value={false} isRequired />
<CheckboxInput
label="Accept terms"
value={false}
status={{message: 'You must accept the terms to continue.', type: 'error'}}
/>
This setting may affect performance.
<CheckboxInput
label="Accept terms"
value
status={{message: 'This setting may affect performance.', type: 'warning'}}
/>
Preference saved.
<CheckboxInput
label="Accept terms"
value
status={{message: 'Preference saved.', type: 'success'}}
/>
<CheckboxInput
label="Enable notifications"
value={false}
startContent={<Icon color="secondary" icon={Bell} size="sm" />}
/>
New
<CheckboxInput
label="Beta features"
value={false}
endContent={<Badge color="blue" label="New" />}
endContentPosition="inline"
/>
New
<CheckboxInput
label="Beta features"
value={false}
endContent={<Badge color="blue" label="New" />}
endContentPosition="end"
/>

A checkbox input with label, description, and validation support.

When isOptional: false, isRequired: false

PropTypeDefaultDescription
aria-labelstring—Accessible name applied to the checkbox input, overriding the label text. Use when a rich label has no useful text. Include any visible label wording.
classNamestring—Additional CSS class names applied to the root element.
data-testidstring—Test ID applied to the input element.
descriptionReactNode—Supporting text rendered below the label.
endContentReactNode—Content rendered after the label.
endContentPosition'end' | 'inline''inline'Where to place endContent within the item. 'end' pushes it to the trailing edge; 'inline' keeps it next to the label.
htmlNamestring—HTML name attribute for native form submission.
htmlValuestring—HTML value attribute for native form submission.
isDisabledbooleanfalseWhether the checkbox is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the checkbox is in a loading state.
isReadOnlybooleanfalseWhether the checkbox is read-only.
label*ReactNode—Field label content.
labelIconIconComponent—Optional content shown before the label.
labelTooltipReactNode—Tooltip content shown next to the label.
onBlur(event: FocusEvent<HTMLInputElement>) => void—Called when the input loses focus.
onChange*(checked: boolean, event: ChangeEvent<HTMLInputElement>) => void—Called when the checked state changes.
onFocus(event: FocusEvent<HTMLInputElement>) => void—Called when the input receives focus.
padding0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 100Inner padding around the checkbox row.
refRef<HTMLInputElement>—Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size of the checkbox.
startContentReactNode—Content rendered after the checkbox control and before the label.
statusInputStatus—Validation status displayed below the checkbox.
styleCSSProperties—Inline styles applied to the root element.
value*boolean | "indeterminate"—Current checked state: true, false, or 'indeterminate'.
widthWidthValue'full'Width of the checkbox item. Numbers are pixels, strings are used as-is, 'full' fills the container.
isOptionalfalse—
isRequiredfalse—

When isOptional: true, isRequired: false

PropTypeDefaultDescription
aria-labelstring—Accessible name applied to the checkbox input, overriding the label text. Use when a rich label has no useful text. Include any visible label wording.
classNamestring—Additional CSS class names applied to the root element.
data-testidstring—Test ID applied to the input element.
descriptionReactNode—Supporting text rendered below the label.
endContentReactNode—Content rendered after the label.
endContentPosition'end' | 'inline''inline'Where to place endContent within the item. 'end' pushes it to the trailing edge; 'inline' keeps it next to the label.
htmlNamestring—HTML name attribute for native form submission.
htmlValuestring—HTML value attribute for native form submission.
isDisabledbooleanfalseWhether the checkbox is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the checkbox is in a loading state.
isReadOnlybooleanfalseWhether the checkbox is read-only.
label*ReactNode—Field label content.
labelIconIconComponent—Optional content shown before the label.
labelTooltipReactNode—Tooltip content shown next to the label.
onBlur(event: FocusEvent<HTMLInputElement>) => void—Called when the input loses focus.
onChange*(checked: boolean, event: ChangeEvent<HTMLInputElement>) => void—Called when the checked state changes.
onFocus(event: FocusEvent<HTMLInputElement>) => void—Called when the input receives focus.
padding0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 100Inner padding around the checkbox row.
refRef<HTMLInputElement>—Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size of the checkbox.
startContentReactNode—Content rendered after the checkbox control and before the label.
statusInputStatus—Validation status displayed below the checkbox.
styleCSSProperties—Inline styles applied to the root element.
value*boolean | "indeterminate"—Current checked state: true, false, or 'indeterminate'.
widthWidthValue'full'Width of the checkbox item. Numbers are pixels, strings are used as-is, 'full' fills the container.
isOptional*true—
isRequiredfalse—

When isOptional: false, isRequired: true

PropTypeDefaultDescription
aria-labelstring—Accessible name applied to the checkbox input, overriding the label text. Use when a rich label has no useful text. Include any visible label wording.
classNamestring—Additional CSS class names applied to the root element.
data-testidstring—Test ID applied to the input element.
descriptionReactNode—Supporting text rendered below the label.
endContentReactNode—Content rendered after the label.
endContentPosition'end' | 'inline''inline'Where to place endContent within the item. 'end' pushes it to the trailing edge; 'inline' keeps it next to the label.
htmlNamestring—HTML name attribute for native form submission.
htmlValuestring—HTML value attribute for native form submission.
isDisabledbooleanfalseWhether the checkbox is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the checkbox is in a loading state.
isReadOnlybooleanfalseWhether the checkbox is read-only.
label*ReactNode—Field label content.
labelIconIconComponent—Optional content shown before the label.
labelTooltipReactNode—Tooltip content shown next to the label.
onBlur(event: FocusEvent<HTMLInputElement>) => void—Called when the input loses focus.
onChange*(checked: boolean, event: ChangeEvent<HTMLInputElement>) => void—Called when the checked state changes.
onFocus(event: FocusEvent<HTMLInputElement>) => void—Called when the input receives focus.
padding0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 100Inner padding around the checkbox row.
refRef<HTMLInputElement>—Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size of the checkbox.
startContentReactNode—Content rendered after the checkbox control and before the label.
statusInputStatus—Validation status displayed below the checkbox.
styleCSSProperties—Inline styles applied to the root element.
value*boolean | "indeterminate"—Current checked state: true, false, or 'indeterminate'.
widthWidthValue'full'Width of the checkbox item. Numbers are pixels, strings are used as-is, 'full' fills the container.
isOptionalfalse—
isRequired*true—