C-18 · Components · Content
All elements · Card on the Components page
Last checked 2026-10-22 · Awaiting approval · Accessibility tests
Approve Card
Approving as
| Axis | Values |
|---|---|
data-orientation · data-density · data-elevation |
vertical · horizontal / compact / none · md |
data-clickable · data-state=selected |
interaction |
__media · __header · __heading · __title ·
__subtitle · __content · __actions ·
__footer
|
slots |
Guidance
When to use
- Show one record as a self-contained summary: title, subtitle, a short body, status and people.
- Show items on a Kanban board with
data-density="compact". -
Show documents or media with a thumbnail in
__media, above the header or beside it withdata-orientation="horizontal". -
Group a block of related settings or a specimen on a page with
data-elevation="none". -
Let users open or pick an item by clicking the whole card with
data-clickable, showing the chosen one withdata-state="selected".
When to consider something else
- When users scan many items and compare a few fields, use List or Table; cards take more space per item. See List.
- When the data is columns of values, use Table. See Table.
- When the message is a status or alert, use Banner. See Banner.
- When the content is a full record with tabs and history, use the Object page. See ObjectDisplay.
Usability
- Keep the title to one line and put the identifier and date in
__subtitle. -
Put at most two actions in
__actions; move the rest to a More Menu in the header. - Use the same slots in the same order across a set of cards so users can scan them.
- Use
__footerfor metadata such as last updated and collaborators.
- Don't nest cards inside cards, except a specimen frame on a docs page.
- Don't make a card clickable when it holds several unrelated actions.
- Don't use elevation to show selection; use
data-state="selected".
Accessibility
Keyboard
| Keys | Action |
|---|---|
| Tab / Shift+Tab | Moves to the card's open control, then to each button inside it. |
| Enter | Opens the card when its main control is focused. |
Roles and names
-
A standalone card is an
article; in a set, render the cards as list items so users hear the count. -
__titleis adiv; the binding should render it as a heading at the right level so heading navigation finds each card. -
A clickable card must have one real link or button, normally on the title, whose name is the title;
stretch its click area over the card in CSS rather than giving the
articlea role. -
The specimen puts
tabindex="0"on thearticle; a focusablearticlehas no role or action, so the binding must not rely on it. -
Selection must be exposed, for example
aria-pressedoraria-selectedon the main control within a selectable group, not onlydata-state.
Focus
- Inner buttons such as More stay separate Tab stops after the card's main control.
- Focus shows the shared focus ring on the main control; when the click area is stretched, draw the ring around the whole card.
- After a card is moved or removed, move focus to the next card.
Other requirements
- Hover adds a fill, border and shadow; keyboard focus needs its own visible ring (2.4.7).
- The selected border and fill need 3:1 against the page (1.4.11).
- Media images need
alttext, oralt=""when decorative. - Cards must reflow into one column at 320px width (1.4.10).
Test your implementation too. This guidance covers the element as specified here. How a screen composes it (labels, order, announcements) still needs its own keyboard and screen reader check.
Accessibility tests
Passed the gate (run 358b316 on 2026-10-22): no finding in any theme. Awaiting a person’s approval of the checklist below.
| Area | Automated | A person checks |
|---|---|---|
| General | Passed | Color is never the only cue, text alternatives say the same thing as the graphic, and the element reads the same in the light and the dark theme. |
| Zoom | Passed | At 200% zoom, at 320 CSS pixels wide and with the WCAG text-spacing overrides, nothing is lost, clipped or overlapping. |
| Keyboard | Passed | Every row of the Keyboard table works, focus is always visible and never trapped, and the tab order follows the reading order. (2 rows) |
| Screen reader | Passed | With NVDA or JAWS on Windows and VoiceOver on macOS, names, roles and states are announced as Roles and names says, and changes are announced once. (5 items) |
Approving. When the checklist passes on the checked run, record it with
bun run a11y:approve -- card --by "Your name" and commit
a11y/approvals.json with the rebuilt pages.
All test status
Package
Consumers link one stylesheet, css/classic/index.css, which includes every element. The
files below are where this element is defined.
Latest updates
No recorded changes yet.