Skip to content

CardVertical

A course card with the image on top and the title, progress and metadata below, optionally with a favorite or overflow action.

Maturity
beta
Links
Storybook · Figma: CardVertical · Figma: CardVertical.Root · Figma: CardVertical examples · Spec source · Usage source

Why it's built this way

Show decisions about
DecisionWhy
The plain <CardVertical /> covers the common cases. Uncommon layouts are built from its named parts, and the plain card is built from the same parts.Adding every layout as a prop would allow combinations that make no sense. Parts keep the common card simple and the unusual one possible. (See ADR-023.)
The card counts as completed when progress reaches 100. There is no completed prop.A separate flag could disagree with the bar, for example completed at 40%. (See ADR-025.)
Favorite and Menu are transparent Buttons with a soft halo behind the icon. The halo belongs to CardVertical, not Button.The icon stays readable on any image, without adding an option to Button. (See ADR-024.)
In the code, the text comes before the image: Body, then Progress, then Media. CSS draws the image on top. Compositions with parts write Body first too.Screen readers reach the title before the image, the Save button and the progress bar, and jumping by heading lands at the start of the card (WCAG 1.3.2). (See ADR-023.)
The progress bar's accessible name is "Completion", not the course title.The bar comes after the title and can't be focused, so repeating the title only adds noise. Favorite and Menu do include the title, because each is its own tab stop.
The card's <article> has no accessible name. It isn't labelled by the title, and you shouldn't give it one.The title is the first thing read inside the card, so a name would repeat it on every card. Unnamed "article" entries in a screen reader's list cost less. (See ADR-023.)
With href set, the whole card opens the course. The link sits inside the title and stretches over the card; the Action button stays clickable on top of it.The title names the link, the heading stays a heading, and Favorite and Menu stay separate tab stops. The cost: the card's text can't be selected with the mouse. (See ADR-023.)
No router dependency: href is a plain string on a plain <a>.Your app's router can handle the click at the app level, as with AppHeader.

Every component follows ADR-025, ADR-026 and ADR-028(states, prop vocabulary, focus indicator); they are not repeated per component.