Componentsv2.189.1
Iconsv1.19.0
MCPv0.8.62
Tokensv0.34.3

OptionCards present the functionality of a radio or checkbox in a more visually prominent card format with an increased click area.

Structure

The OptionCard component renders a native HTML <input> element (either type="radio" or type="checkbox", depending on configuration) wrapped inside a <label> element. The wrapping <label> makes the entire card surface a click target for the input, so users can select or deselect the card by clicking anywhere within it. The input is visually hidden but remains in the accessibility tree. The card's title or ariaLabel provides its accessible name.

When used inside an OptionCardGroup, the group renders as a <fieldset> element with an optional <legend>, giving assistive technology a semantic boundary for the set of related options. Title and description text within each card render as <span> elements with no inherent accessible roles.

ARIA

table
ElementAttributeDescription
Fieldsetaria-labelProvides an accessible name for the OptionCardGroup when no visible legend is rendered.
Fieldsetaria-labelledbyReferences an external element that labels the OptionCardGroup.
Inputaria-describedbyReferences an external element that provides additional context for the input.
Inputaria-labelProvides an accessible name when no visible title is rendered.
Inputaria-labelledbyReferences an external element that labels the input.

Decorative elements

Icons and custom images inside the card are treated as decorative. The icon prop renders an Icon component that receives a color adjustment when disabled but carries no accessible name of its own. The iconSrc prop renders an Image with an empty alt attribute, ensuring screen readers skip it entirely. Meaning should always come from the card's title or ariaLabel, never from the icon or image alone.

Labels

We highly recommend adding a visible title with the title prop. If a visible title is unneeded for the use case, add an ariaLabel or ariaLabelledby so assistive technology will announce the card to the user. Because the <label> element wraps both the input and the card content, the title text automatically serves as the input's accessible name without requiring explicit ID linking.

Keyboard

table
KeyFunction
SpaceToggles the card when the input type is checkbox. Selects the card when the input type is radio.
Shift+TabMoves focus to the previous focusable element.
TabMoves focus to the next focusable element. Within a radio group, only the selected (or first) radio is in the tab order.
Moves selection between radio inputs within the same group. Not applicable to checkbox inputs.

On this page