Skip to content

Checkbox / CheckboxGroup

Two components: Checkbox for a standalone toggle, and CheckboxGroup for a labelled set of related checkboxes. Both wrap the corresponding React Aria primitives.

Terminal window
npx @a2ra/cli add checkbox
{
"type": "CheckboxGroup",
"props": {
"label": "Interests",
"name": "interests",
"orientation": "horizontal"
},
"children": [
{ "type": "Checkbox", "props": { "label": "Design", "value": "design" } },
{ "type": "Checkbox", "props": { "label": "Engineering", "value": "eng" } }
]
}
PropTypeDescription
labelstringVisible label text
valuestringValue submitted with the form
namestringForm field name
isSelectedbooleanControlled checked state
defaultSelectedtrue
false default
Uncontrolled default
isDisabledtrue
false default
Disables the checkbox
isRequiredtrue
false default
Marks as required
isIndeterminatetrue
false default
Shows indeterminate state
isReadOnlytrue
false default
Prevents toggling
isInvalidtrue
false default
Shows error styling
validationBehavioraria default
native
Validation strategy
errorMessagestringError text when isInvalid is true
PropTypeDescription
labelstringGroup label
valuestring[]Controlled selected values
defaultValuestring[]Uncontrolled default
isDisabledtrue
false default
Disables all checkboxes
isRequiredtrue
false default
Marks group as required
isReadOnlytrue
false default
Prevents any changes
isInvalidtrue
false default
Shows error styling on the group
validationBehavioraria default
native
Validation strategy
orientationhorizontal
vertical default
Layout direction
namestringForm field name
descriptionstringHelper text
errorMessagestringError text when isInvalid is true
childrennode[]Checkbox child nodes
  • CheckboxGroup manages keyboard navigation and ARIA group labelling automatically.
  • isIndeterminate is a visual-only state; it does not affect the submitted form value.