Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Checkbox Cards
  3. API and Development

Checkbox cards

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
CheckboxCards drives Radix CheckboxCards with an options array. Each entry renders a CheckboxCard with value, label, optional description, and layout flags. The group supports controlled value / onValueChange, indicatorPosition, indicatorHidden, horizontal (lays cards out in a single row), disabled, and readOnly (shows lock affordance and blocks changes).
CheckboxCards
NameTypeDefaultDescription
legendLocalizedMessage—Group name, rendered in the Fieldset legend; it is the group's accessible name.
childrenReactNode—{@link CheckboxCard } items.
classNamestring—Classes on the host fieldset. Put overrides in @layer chroma.overrides.
defaultValuereadonly string[]—Initial selected values when uncontrolled, and the values a native form reset restores.
descriptionLocalizedMessage—Group helper copy linked through aria-describedby.
disabledbooleanfalseDisables every card through native fieldset[disabled].
errorLocalizedMessage—Group error copy. When set, it is linked through aria-describedby and every card input is aria-invalid with the invalid indicator.
formstring—Id of the form that owns the inputs when they sit outside it.
indicatorPositionCheckboxCardsIndicatorPositionCheckboxCardsIndicatorPosition.StartWhere each card draws its indicator.
legendVisibilityFieldsetLegendVisibility—Hides the legend visually; the copy stays in the legend. Defaults to visible.
namestring—Form field name shared by every card input. Omit to keep the cards out of form submission.
onBlurFocusEventHandler<HTMLElement>—Called once when focus leaves the whole group for somewhere outside it, such as the next field. It is not called when focus moves between cards, so a form library validates on blur once per visit.
onFocusFocusEventHandler<HTMLElement>—Called once when focus enters the group from outside it. It is not called when focus moves between cards. Use it with onBlur to track whether the group was touched.
onValueChange((value: string[], details: ChangeDetails<CheckboxCardsValueChangeReason>) => void)—Called for every selection change, including controlled mode and form reset. InputChange is cancelable; FormReset is not, because the browser restores the inputs either way.
orientationCheckboxCardsOrientationCheckboxCardsOrientation.VerticalMain-axis layout of the cards.
readOnlybooleanfalseMakes every card read only: selected state shows and cards stay focusable, but activation changes nothing. Each card shows a lock glyph opposite its indicator.
refRef<HTMLFieldSetElement>—Ref to the host fieldset.
valuereadonly string[]—Controlled selected values. undefined on the first render is uncontrolled.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Option fields (CheckboxCardProps)
NameTypeDefaultDescription
valuestringrequiredStable id.
labelLocalizedMessage | DisplayValuerequiredPrimary line. Copy from formatMessage, or data from toDisplayValue.
descriptionReactNode—Secondary line.
indicatorPosition"left" | "right"—Overrides group default when supported.
indicatorHiddenboolean—Per-card indicator visibility.
readOnlybooleanfalseLock icon when group is read-only.
Example
CheckboxCard
A card-based pattern for more descriptive or visual options.
Basic Card
Use for simple selections with an optional description.
With Description
Provide added context or benefits.
Disabled Cards
Disable options based on conditions.
Right Indicators
Indicators can also appear on the right-side of the checkbox card for elements aligned to the right-hand side of the page.
Hidden Indicators
Hide the checkbox indicator when you do not want a visible state.
CheckboxCards
Manage multiple cards with controlled or uncontrolled selection.
Multiple Selection
Allow selecting more than one option.
Controlled Selection
Control selection state externally for complex flows.
Disabled Group
Disable all cards when selection is unavailable.
Right-Aligned Indicators
Place indicators on the right for alternate layouts.
Previous
Checkbox Cards / Usage
Next
Checkbox Cards / Accessibility
On this page
CheckboxCards
Storybook
Option fields (CheckboxCardProps)
Example
CheckboxCard
Basic Card
With Description
Disabled Cards
Right Indicators
Hidden Indicators
CheckboxCards
Multiple Selection
Controlled Selection
Disabled Group
Right-Aligned Indicators