Skip to main content

Design system components

SelectableCard

A Card that is one selectable option; grouped into single (radio) or multiple (checkbox) sets via SelectableCardGroup.

Status: stable. Group: form. Markdown version: /design-system/components/selectable-card.md

When to use

Use SelectableCardGroup for visually prominent form choices, with SelectableCard children representing radio-style exclusive options or checkbox-style multiple options. The group owns the legend, value state, and error relationship.

When not to use

  • Do not nest interactive controls (buttons, links) inside a SelectableCard; the whole card is a label wrapping the input, so nested controls steal the click. Use a plain Card for action cards.
  • Do not use it for navigation; selecting must not commit or route on click.

Look-alikes

  • Card: Do not nest buttons or links inside a selectable card; use Card for action-oriented content.
  • CheckboxGroup: For bare text options without supporting content, use RadioGroup or CheckboxGroup.
  • RadioGroup: For bare text options without supporting content, use RadioGroup or CheckboxGroup.

Props

SelectableCard props
PropTypeDefaultDescriptionRequired
valuestringnoneSubmitted value / selection key.Yes
disabledbooleanfalsePer-card disable; the choice stays visible.No
selectedbooleannoneStandalone selected state when used outside a SelectableCardGroup.No
onSelectedChange(selected: boolean) => voidnoneStandalone change handler when used outside a SelectableCardGroup.No

Variants

No variant dimensions and no props with a fixed set of values.

Invalid combinations

The contract records no invalid combinations.

Keyboard

SelectableCard keyboard behaviour
KeyBehaviour
TabMoves focus into the group.
Arrow keysMove within a single-select set (native radio)
SpaceToggles the focused option.

Rules

Every item under When not to use is a MUST NOT. MUST and SHOULD follow RFC 2119.

SelectableCard rules
LevelRuleHow it is checked
MUSTARIA: Group renders a fieldset with a legend for the accessible name.Not yet verified: no evidence record. WCAG 4.1.2.
MUSTARIA: Each card is a label wrapping a native radio/checkbox input.Not yet verified: no evidence record. WCAG 4.1.2.
MUSTARIA: Error announces via role=alert and sets aria-invalid on the group.Not yet verified: no evidence record. WCAG 4.1.2.
MUSTRequired stories produce no axe violations at the configured severity.Automated by npm run test:stories:matrix:ci. WCAG 2.5.8.
MUSTThe accessibility tree (role, name, state) matches the committed snapshot for every required story.Automated by npm run test:stories:matrix:ci. WCAG 1.3.1, 4.1.2.
MUSTThe component remains legible and operable under a real browser forced-colors: active pass.Automated by npm run test:stories:hc.
MUSTEvery documented keyboard interaction works as specified.Not yet verified: no evidence record. WCAG 2.1.1, 2.1.2.
MUSTA human completed an end-to-end accessibility review of this component.Manual review, last on 2026-11-04.
SHOULDWrite the group legend as the question and keep each card title short and scannable.Not stated in the contract.
SHOULDUse single selection for a few rich exclusive options and multiple selection for independent add-ons.Not stated in the contract.
SHOULDFor one standalone toggle outside a group, control selected and onSelectedChange directly.Not stated in the contract.
SHOULD NOTDo not nest buttons or links inside a selectable card; use Card for action-oriented content.Not stated in the contract.
SHOULD NOTFor bare text options without supporting content, use RadioGroup or CheckboxGroup.Not stated in the contract.

Install and import

  • Install: npm install @digitaltableteur/react (version 0.9.1, restricted access on npm).
  • Import: import { SelectableCard } from "@digitaltableteur/react";
  • Entry point: @digitaltableteur/react/forms exports it too.
  • Styles: import @digitaltableteur/react/style.css once at the app boundary.
  • Also available as the custom element <dt-selectable-card>; see the custom elements manifest.