ref | React.Ref<HTMLInputElement>Ref forwarded to the underlying <input> element. |
|---|
label | string · requiredLabel text for the checkbox (always rendered for accessibility). |
|---|
isLabelHidden | boolean · default falseWhether to visually hide the label (still accessible to screen readers). |
|---|
description | stringDescription text displayed below the label. |
|---|
value | boolean | 'indeterminate' · requiredWhether the checkbox is checked, unchecked, or indeterminate. |
|---|
onChange | (checked: boolean, e: ChangeEvent<HTMLInputElement>) => voidCallback fired when the checkbox state changes. |
|---|
changeAction | (checked: boolean, e: ChangeEvent<HTMLInputElement>) => void | Promise<void>Async action on change. Fires after onChange if not prevented. Shows loading spinner while pending. |
|---|
isLoading | boolean · default falseWhether the checkbox is in a loading state. Shows spinner and prevents interaction. |
|---|
isDisabled | boolean · default falseWhether the checkbox is disabled. |
|---|
htmlName | stringThe HTML name attribute for the underlying checkbox input, useful for form submissions (submits "on" when checked). |
|---|
disabledMessage | stringExplains why the checkbox is disabled. With isDisabled, shows a tooltip on hover/keyboard focus and keeps the checkbox focusable via aria-disabled (toggling stays blocked). Use this instead of wrapping a disabled CheckboxInput in Tooltip. Disabled controls swallow the hover events an external Tooltip needs. |
|---|
isReadOnly | boolean · default falseWhether the checkbox is read-only. Displays the current state at full opacity but prevents interaction. Unlike isDisabled, read-only checkboxes are not visually dimmed. |
|---|
isOptional | boolean · default falseWhether the field is optional. Mutually exclusive with isRequired. |
|---|
isRequired | boolean · default falseWhether the checkbox is required. Mutually exclusive with isOptional. |
|---|
size | 'sm' | 'md' · default 'md'The size of the checkbox. sm for compact layouts, md for default. |
|---|
onFocus | (e: FocusEvent<HTMLInputElement>) => voidCallback fired when the checkbox receives focus. |
|---|
onBlur | (e: FocusEvent<HTMLInputElement>) => voidCallback fired when the checkbox loses focus. |
|---|
labelIcon | ReactNode | IconTypeSemantic icon name or custom content displayed before the label text. See astryx docs icons for valid semantic names. |
|---|
status | { type: 'error' | 'warning' | 'success', message: string }Status indicator. Displays a colored message box below the checkbox and sets aria-invalid for errors. |
|---|
width | SizeValueWidth of the field (number = pixels, string used as-is, e.g. "100%"). Sizes the whole field (label, control, and status) so they stay aligned. |
|---|