Checkbox

The Checkbox component is a versatile form control for selecting one or multiple options.

Usage & Examples

Default

default.tsx
<Checkbox label="Accept Terms" checked={checked} onChange={...} />

Props API

30 props
Columns
Checkbox props API
Default
Description
aria-describedbystringNoariaID reference(s) to element(s) that describe the checkbox. This may include helper text, error text, or external descriptions.
aria-errormessagestringNoariaID reference to the element containing the error message. Typically used together with aria-invalid.
aria-labelstringNoariaAccessible label for the checkbox when no visible label is present or when a more descriptive label is needed.
aria-labelledbystringNoariaID reference(s) to element(s) that label the checkbox. If provided, this takes precedence over the internal label association.
boxClassNamestringNopropsAdditional class names for the visual checkbox box.
checkedbooleanYespropsChecked state of the checkbox.
classNamestringNostylingCustom class name for additional styling.
data-testidstringNotestingBackward-compatible alias for test ID attributes.
descriptionReactNodeNopropsVisible helper text rendered below or beside the checkbox. Should provide extra guidance for the user.
descriptionClassNamestringNopropsAdditional class names for the helper description.
disabledbooleanNopropsfalseWhether the checkbox is disabled.
errorMessageReactNodeNopropsVisible error message rendered for invalid state. This can also be referenced by assistive technologies.