CheckboxInput
A checkbox input with label, description, and validation support.
Examples
Section titled “Examples”Default
Section titled “Default”<CheckboxInput label="Accept terms" value={false} />Checked
Section titled “Checked”<CheckboxInput label="Accept terms" value />Indeterminate
Section titled “Indeterminate”<CheckboxInput label="Accept terms" value="indeterminate" />With Description
Section titled “With Description”Receive weekly product updates and announcements.
<CheckboxInput label="Subscribe to newsletter" value={false} description="Receive weekly product updates and announcements."/><CheckboxInput label="Accept terms" value={false} size="sm" /><CheckboxInput label="Accept terms" value={false} size="lg" />Disabled
Section titled “Disabled”<CheckboxInput label="Accept terms" value isDisabled />Read Only
Section titled “Read Only”<CheckboxInput label="Accept terms" value isReadOnly />Loading
Section titled “Loading”<CheckboxInput label="Accept terms" value isLoading />Required
Section titled “Required”<CheckboxInput label="Accept terms" value={false} isRequired />You must accept the terms to continue.
<CheckboxInput label="Accept terms" value={false} status={{message: 'You must accept the terms to continue.', type: 'error'}}/>Warning
Section titled “Warning”This setting may affect performance.
<CheckboxInput label="Accept terms" value status={{message: 'This setting may affect performance.', type: 'warning'}}/>Success
Section titled “Success”Preference saved.
<CheckboxInput label="Accept terms" value status={{message: 'Preference saved.', type: 'success'}}/>With Icon
Section titled “With Icon”<CheckboxInput label="Enable notifications" value={false} startContent={<Icon color="secondary" icon={Bell} size="sm" />}/>End Content Inline
Section titled “End Content Inline”New
<CheckboxInput label="Beta features" value={false} endContent={<Badge color="blue" label="New" />} endContentPosition="inline"/>End Content End
Section titled “End Content End”New
<CheckboxInput label="Beta features" value={false} endContent={<Badge color="blue" label="New" />} endContentPosition="end"/>CheckboxInput
Section titled “CheckboxInput”A checkbox input with label, description, and validation support.
When isOptional: false, isRequired: false
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS class names applied to the root element. |
data-testid | string | — | Test ID applied to the input element. |
description | ReactNode | — | Supporting text rendered below the label. |
endContent | ReactNode | — | 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. |
htmlName | string | — | HTML name attribute for native form submission. |
htmlValue | string | — | HTML value attribute for native form submission. |
isDisabled | boolean | false | Whether the checkbox is disabled. |
isLabelHidden | boolean | false | Whether to visually hide the label. |
isLoading | boolean | false | Whether the checkbox is in a loading state. |
isReadOnly | boolean | false | Whether the checkbox is read-only. |
label* | string | — | Field label text. |
labelIcon | IconComponent | — | Optional content shown before the label. |
labelTooltip | ReactNode | — | 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. |
ref | Ref<HTMLInputElement> | — | Ref forwarded to the input element. |
size | "sm" | "md" | "lg" | 'md' | Visual size of the checkbox. |
startContent | ReactNode | — | Content rendered after the checkbox control and before the label. |
status | InputStatus | — | Validation status displayed below the checkbox. |
style | CSSProperties | — | Inline styles applied to the root element. |
value* | boolean | "indeterminate" | — | Current checked state: true, false, or 'indeterminate'. |
width | 'auto' | 'full' | 'full' | Width of the checkbox item. |
isOptional | false | — | |
isRequired | false | — |
When isOptional: true, isRequired: false
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS class names applied to the root element. |
data-testid | string | — | Test ID applied to the input element. |
description | ReactNode | — | Supporting text rendered below the label. |
endContent | ReactNode | — | 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. |
htmlName | string | — | HTML name attribute for native form submission. |
htmlValue | string | — | HTML value attribute for native form submission. |
isDisabled | boolean | false | Whether the checkbox is disabled. |
isLabelHidden | boolean | false | Whether to visually hide the label. |
isLoading | boolean | false | Whether the checkbox is in a loading state. |
isReadOnly | boolean | false | Whether the checkbox is read-only. |
label* | string | — | Field label text. |
labelIcon | IconComponent | — | Optional content shown before the label. |
labelTooltip | ReactNode | — | 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. |
ref | Ref<HTMLInputElement> | — | Ref forwarded to the input element. |
size | "sm" | "md" | "lg" | 'md' | Visual size of the checkbox. |
startContent | ReactNode | — | Content rendered after the checkbox control and before the label. |
status | InputStatus | — | Validation status displayed below the checkbox. |
style | CSSProperties | — | Inline styles applied to the root element. |
value* | boolean | "indeterminate" | — | Current checked state: true, false, or 'indeterminate'. |
width | 'auto' | 'full' | 'full' | Width of the checkbox item. |
isOptional* | true | — | |
isRequired | false | — |
When isOptional: false, isRequired: true
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS class names applied to the root element. |
data-testid | string | — | Test ID applied to the input element. |
description | ReactNode | — | Supporting text rendered below the label. |
endContent | ReactNode | — | 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. |
htmlName | string | — | HTML name attribute for native form submission. |
htmlValue | string | — | HTML value attribute for native form submission. |
isDisabled | boolean | false | Whether the checkbox is disabled. |
isLabelHidden | boolean | false | Whether to visually hide the label. |
isLoading | boolean | false | Whether the checkbox is in a loading state. |
isReadOnly | boolean | false | Whether the checkbox is read-only. |
label* | string | — | Field label text. |
labelIcon | IconComponent | — | Optional content shown before the label. |
labelTooltip | ReactNode | — | 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. |
ref | Ref<HTMLInputElement> | — | Ref forwarded to the input element. |
size | "sm" | "md" | "lg" | 'md' | Visual size of the checkbox. |
startContent | ReactNode | — | Content rendered after the checkbox control and before the label. |
status | InputStatus | — | Validation status displayed below the checkbox. |
style | CSSProperties | — | Inline styles applied to the root element. |
value* | boolean | "indeterminate" | — | Current checked state: true, false, or 'indeterminate'. |
width | 'auto' | 'full' | 'full' | Width of the checkbox item. |
isOptional | false | — | |
isRequired* | true | — |