Checkbox API
API reference docs for theCheckbox
component. For examples and details on the usage of this component, visit the component demo page.
Props
Prop | Type | Description | Default |
---|---|---|---|
|
| Label for the checkbox describing its purpose. | _ |
|
| Disables the checkbox, making it non-interactive and visually styled as disabled. |
|
|
| The size of the checkbox. |
|
|
| Defines the value of the checkbox input, used when submitting a form. | _ |
|
| Indicates whether the checkbox is checked, used in controlled components. | _ |
|
| A unique ID for the checkbox. | _ |
|
| The name attribute of the checkbox, useful for grouping in forms. | _ |
|
| Description text displayed alongside the checkbox, providing additional context. | _ |
|
| Message shown when the field is invalid, styled for error state and announced to screen-readers as invalid. | _ |
|
| Defines the ID of the element that provides additional information about the checkbox for accessibility purposes. | _ |
|
| Function called when the checkbox loses focus. | _ |
|
| Function called when the checkbox is clicked. | _ |
|
| Function called when the checkbox’s value changes. | _ |
|
| Indicates whether checkbox in an indeterminate state or not. Designed for scenarios like header groups where some, but not all, options are selected. |
|
Note: For id
and aria-describedby
, if a value is provided, the IDs will be merged. Otherwise, React.useId
will be used to generate unique IDs to associate the labels appropriately.