Card
When to use it
Section titled “When to use it”- Use type listing for something people can open or book: a stay, an experience, or a trip, with a photo, a title, one details line and the price.
- Turn on ShowTag for a status on the photo, such as “Confirmed”, and ShowAction for a text action such as “View”; turn ShowRating off when there are no reviews yet.
- Use type stat in the back office for one key number, such as “Active admins 27”, in a row of 3 to 5 tiles at the top of a page.
3 more lines in use_when in src/components/Card/Card.intent.json (items 4 to 6) are Figma’s Best Practice lines, word for word. They are listed once, under “Best practice” below.
Property names. Item 2 (Figma node 239:57) is copied from Figma as written, with Figma’s spelling of the properties. The code spells them showTag and showAction and showRating.
When not to use it
Section titled “When not to use it”- For rows of data people compare or sort: use a Table.
Instead: Table - To choose one option in a form: use Radiocard.
Instead: RadioCard - For a stat that needs a chart or several numbers: use a content panel, not a stat tile.
The Figma page names no alternative.
Open item: no alternative named for item 3. The item has an empty instead in Card.intent.json; the Figma page names no component there (“a content panel” is not a Horizon component).
From the release review, under “Warnings (not blocking)”, as written:
C2: dont_use_when entry 3 has an empty instead (“a content panel”, not a Horizon component). Owner: doc-generator or the designer, if a component is ever named.
Open item: pairs_with. From the release review, under “Warnings (not blocking)”, as written:
pairs_with: [“Image”] in Card.intent.json. Stories render Card alone and show no pairing; Image appears because Card uses it internally (the board records that in Composes). Named in the ruling’s “Not ruled” line, so raised as a warning and not waived. Owner: doc-generator, to confirm or empty it.
Best practice
Section titled “Best practice”From the Figma documentation page (usage node 239:51), as written. These items aren’t carried into Card.intent.json, which has no field for them.
- Keep every card in a grid the same width and photo ratio, so titles and prices line up.
- One line each for title and details: they cut off with … rather than wrap.
- Make the whole listing card clickable, and keep the Action for a second, smaller step.
Where the built component differs. Item 3 (Figma node 239:68) is copied from Figma as written. It is a design instruction, not something Card does: the card is a plain <div> (Card.tsx:60) with no role, no tabIndex, no keyboard handling and no focus style (Card.css has no :focus rule), and Figma draws no focus state. Caller attributes are spread onto the <div>, so a consumer who adds onClick gets a mouse-only target. The a11y entries in Card.intent.json do not say so. This is a documentation gap for the designer and a human, not a feature.
From the release review, under “Warnings (not blocking)”, as written:
The intent’s best practice “Make the whole listing card clickable” has no support in the component: the container is a plain <div> with no role, keyboard handling or focus style (Figma draws no focus state). A consumer who adds onClick through the spread gets a mouse-only target, and the a11y entries do not say so. Named in the ruling’s “Not ruled” line. Owner: doc-generator and a human.
What each variant is for
Section titled “What each variant is for”| Property | Value | What it is for |
|---|---|---|
type |
listing |
something people can open or book: a stay, an experience, or a trip, with a photo, a title, one details line and the price |
type |
stat |
a back office KPI tile: one key number, in a row of 3 to 5 tiles at the top of a page |
Accessibility
Section titled “Accessibility”- The photo is Horizon’s Image component, a native <img>, and imageAlt (default empty, so decorative) is passed to its alt.
src/components/Card/Card.tsx:62 - The card is a plain <div> with no role; title, details and price are <p> text, so they read in DOM order. Caller-supplied attributes (onClick, role, aria-*) are spread onto the container.
src/components/Card/Card.tsx:60
Composition
Section titled “Composition”Card.intent.json lists Image in pairs_with, but no story composes Card with it: Card.stories.tsx never imports or renders it, and every story renders Card alone. This page does not assert the pairing. What is true is composition inside the component: Card.tsx is built from Image, as the registry’s Composes column records and the Code tab shows.
What this version promises
Section titled “What this version promises”From Versioning (VERSIONING.md at b9ffb76):
0.3.0 adds six components on top of 0.2.1: Calendar, Card, Form, Modal, SideBar and Table. It contains twenty-three components, each exported from the package root with its props type: Avatar, Breadcrumbs, Button, ButtonGroup, Calendar, Card, Checkbox, Chip, Dropdown, File, Form, Header, Image, Link, Logo, Modal, ProgressBar, RadioCard, SearchBar, SideBar, Stepper, Table, Toggle. Textfield is exported from the package root as well, with TextfieldProps and TextfieldState, and is public like the others (see decisions.md, 2026-10-07, Textfield). It commits you to their props, prop values and defaults, their hz- class names, the tokens in tokens.css and the three entry points (., ./styles.css, ./tokens.css). Everything in 0.3.0 beyond 0.2.1 is an addition: nothing from 0.2.1 was changed, removed or renamed. A change that breaks any of these on 0.x bumps the version to 0.4.0.
Two things about this release are worth knowing:
- Form, Modal and Table each passed release review with their literal sizes covered by a ruling in decisions.md (Card, SideBar and Calendar have their own), because no size tokens exist for them. Those literals are accepted until the designer adds matching tokens, so a later change to use tokens at the same rendered sizes would be a patch, not a breaking change.
- Dark theme is not verified for Table, and its warning tag has low contrast. The Table docs page says so. Neither is a breaking-change risk, but a fix that changes a token’s value is a patch and is listed in the changelog.
Stories
Section titled “Stories”Listing With Tag
Section titled “Listing With Tag”Listing With Action
Section titled “Listing With Action”Listing Without Rating
Section titled “Listing Without Rating”Listing Tag And Action
Section titled “Listing Tag And Action”Listing Truncation
Section titled “Listing Truncation”Stat Without Helper
Section titled “Stat Without Helper”Stat With Action
Section titled “Stat With Action”All Variants
Section titled “All Variants”The single-variant stories (Listing, Stat) are rows of the variant matrix; the Design tab links each one.
Import
Section titled “Import”import { Card } from "@layerbasesystemic/horizon-design-system";import type { CardProps, CardType } from "@layerbasesystemic/horizon-design-system";@layerbasesystemic/horizon-design-system/tokens.css and @layerbasesystemic/horizon-design-system/styles.css must be loaded too; see Developing.
Card.tsx is built from Image: it imports it (Card.tsx:3) and renders <Image> (Card.tsx:62). The registry’s Composes column for Card lists Image.
| Prop | Type | Default | Description |
|---|---|---|---|
type |
CardType |
"listing" |
— |
image |
string |
— | listing: photo source. |
imageAlt |
string |
"" |
listing: alt text for the photo. Empty means decorative. |
showTag |
boolean |
false |
— |
tag |
string |
"Confirmed" |
— |
title |
string |
"Casa do Bairro" |
— |
details |
string |
"Alfama, Lisbon · 14 to 18 Sep" |
— |
price |
string |
"121 EUR" |
— |
showRating |
boolean |
true |
— |
rating |
string |
"4.7 (318)" |
— |
showAction |
boolean |
false |
— |
action |
string |
"View" |
— |
label |
string |
"Active admins" |
stat: the small caption above the value. |
value |
string |
"27" |
— |
showHelper |
boolean |
true |
— |
helper |
string |
"across 4 properties" |
— |
CardProps also extends Omit<HTMLAttributes<HTMLDivElement>, "title">, so native attributes pass through to the element (Card.tsx:7).
Union types
Section titled “Union types”CardType: listing, stat
Tokens it needs
Section titled “Tokens it needs”Every CSS custom property Card.css reads, with its value in the token build at b9ffb76.
| Token | Light | Dark |
|---|---|---|
--border-width-sm |
1px |
same as light |
--color-bg-elevated |
#f9fafb |
#4d5361 |
--color-border-subtle |
#eef1f5 |
#272a37 |
--color-status-success |
#229c4a |
#4dba6d |
--color-status-success-bg |
#e8faee |
#0b4721 |
--color-text-link |
#1d44ba |
#94b3fc |
--color-text-primary |
#161925 |
#f9fafb |
--color-text-secondary |
#4d5361 |
#9ca2b1 |
--fontfamily-body |
Inter |
same as light |
--fontsize-3xl |
24px |
same as light |
--fontsize-md |
12px |
same as light |
--fontsize-sm |
11px |
same as light |
--fontsize-xl |
14px |
same as light |
--fontsize-xs |
10px |
same as light |
--lineheight-3xl |
32px |
same as light |
--lineheight-md |
18px |
same as light |
--lineheight-sm |
16px |
same as light |
--lineheight-xl |
20px |
same as light |
--lineheight-xs |
16px |
same as light |
--radius-full |
999px |
same as light |
--radius-md |
12px |
same as light |
--radius-xs |
2px |
same as light |
--spacing-lg |
16px |
same as light |
--spacing-md |
12px |
same as light |
--spacing-sm |
8px |
same as light |
--spacing-xs |
4px |
same as light |
This matches required_tokens in Card.intent.json exactly.
Figma node
Section titled “Figma node”Page Card (57:1648), documentation frame ❖ card (239:3), component set card (238:24). The file is shared with the team only, so the frame and the link ask anyone outside it to sign in.
Variant matrix
Section titled “Variant matrix”type (2) = 2 cells. The component set (238:24) publishes two variants, type=listing (238:7, 284x242) and type=stat (238:20, 234x96). ShowTag, ShowAction, ShowRating (listing) and ShowHelper (stat) are boolean properties of the set, not variants; the documentation frame (233:2709) lays out 32 instances of them (2 types x ShowTag x ShowAction x ShowRating or ShowHelper). Figma draws no hover, pressed, focus or disabled state.
type |
Figma node | Story |
|---|---|---|
listing |
238:7 |
Listing |
stat |
238:20 |
Stat |
Themes
Section titled “Themes”The card documentation frame renders every instance in one theme. It has no separate light and dark frames.
The token build defines 179 tokens for light and redeclares 50 for dark; the Code tab shows Card’s tokens in both.
Values Figma never bound
Section titled “Values Figma never bound”Values on the Figma node that aren’t bound to a variable, and what Card.css at b9ffb76 does with each.
| Layer | Property | Figma value | In the code |
|---|---|---|---|
| card, type=listing (238:7) | width | 284px |
width: 284px; |
| card, type=stat (238:20) | width | 234px |
width: 234px; |
| Image, type=listing (238:8) | height (an aspect ratio of 284 by 142, which is 2:1) | 142px |
Not set in Card.css: Card renders the Image component at ratio 2:1 (Card.tsx, the Image element): src/components/Card/Card.tsx |
| Tag, type=listing with ShowTag (238:10) | left | 11px |
left: var(--spacing-md); |
| Tag, type=listing with ShowTag (238:10) | top | 11px |
top: var(--spacing-md); |
| Tag, type=listing with ShowTag (238:10) | padding, left and right | 9px |
padding-inline: var(--spacing-sm); |
| Tag, type=listing with ShowTag (238:10) | padding, top and bottom | 3px |
padding-block: var(--spacing-xs); |
| Footer, type=listing (238:15) | padding-top | 4px |
padding-top: var(--spacing-xs); |
| Title, type=listing (238:13) | font size | 14px |
font-size: var(--fontsize-xl); |
| Details, type=listing (238:14) | font size | 11px |
font-size: var(--fontsize-sm); |
| card border, both types (238:7, 238:20) | border colour (bound in Figma to the variable color/border/subtle, which is not named like a –color-… token; the code reads –color-border-subtle) | #eef1f5 |
box-shadow: inset 0 0 0 var(--border-width-sm) var(--color-border-subtle); |
Figma variables against the token build
Section titled “Figma variables against the token build”| Figma variable | Figma value | Token in the build | Built light value | Agrees |
|---|---|---|---|---|
--radius-none |
0 |
--radius-none |
0px |
yes |
--color-text-primary |
#161925 |
--color-text-primary |
#161925 |
yes |
--fontSize-xl |
14 |
--fontsize-xl |
14px |
yes |
--fontWeight-semibold |
Semi Bold |
no such token | — | no token |
--fontFamily-body |
Inter |
--fontfamily-body |
Inter |
yes |
--lineHeight-xl |
20 |
--lineheight-xl |
20px |
yes |
--color-text-secondary |
#4d5361 |
--color-text-secondary |
#4d5361 |
yes |
--fontSize-sm |
11 |
--fontsize-sm |
11px |
yes |
--fontWeight-regular |
Regular |
no such token | — | no token |
--lineHeight-sm |
16 |
--lineheight-sm |
16px |
yes |
--spacing-md |
12 |
--spacing-md |
12px |
yes |
--spacing-xs |
4 |
--spacing-xs |
4px |
yes |
--spacing-lg |
16 |
--spacing-lg |
16px |
yes |
--radius-md |
12 |
--radius-md |
12px |
yes |
--border-width-sm |
1 |
--border-width-sm |
1px |
yes |
--color-bg-elevated |
#f9fafb |
--color-bg-elevated |
#f9fafb |
yes |
--fontWeight-medium |
Medium |
no such token | — | no token |
--fontSize-3xl |
24 |
--fontsize-3xl |
24px |
yes |
--lineHeight-3xl |
32 |
--lineheight-3xl |
32px |
yes |
--radius-xs |
2 |
--radius-xs |
2px |
yes |
--color-status-success-bg |
#e8faee |
--color-status-success-bg |
#e8faee |
yes |
--color-status-success |
#229c4a |
--color-status-success |
#229c4a |
yes |
--color-text-link |
#1d44ba |
--color-text-link |
#1d44ba |
yes |
--fontSize-xs |
10 |
--fontsize-xs |
10px |
yes |
--lineHeight-xs |
16 |
--lineheight-xs |
16px |
yes |
--fontSize-md |
12 |
--fontsize-md |
12px |
yes |
--lineHeight-md |
18 |
--lineheight-md |
18px |
yes |
--radius-full |
999 |
--radius-full |
999px |
yes |
--fontWeight-semibold, --fontWeight-regular, --fontWeight-medium are bound in Figma but the token build has no token of that name.
Design gaps recorded against it
Section titled “Design gaps recorded against it”Tag offset and size. From the release review, quoting the 2026-10-07 ruling, as written:
The tag in Card.css stays on the nearest tokens: offset –spacing-md (12px), padding –spacing-xs block and –spacing-sm inline (4px / 8px), 24px tall. Figma 238:10 reads 11px offset, 3px / 9px padding and 22px tall. This deviation is accepted as a design decision (2026-10-07), the Figma node was not changed, and the QA report (reports/Card/qa-report.md, round 2) records it.
- 2026-10-07 · Card widths with no token, and the accepted tag offset (decisions.md). These literals in src/components/Card/Card.css are accepted, because they are what the Figma nodes specify, until the designer adds matching size tokens. Accepted values:
284px(width,.hz-card--listing, line 27);234px(width,.hz-card--stat, line 34). Not ruled: Any other literal value, including a var() fallback. These values in any other component. A change to these values: a different number needs a new ruling or a token. The tag’s size, colours or font, which match Figma. The intent file’s pairs_with: [“Image”] and its “make the whole listing card clickable” line, which the review raised as warnings.
Every commit to src/components/Card up to b9ffb76, newest first, with the published version that carries it.
| Commit | Date | Version | Change |
|---|---|---|---|
156db81 |
2026-10-07 | 0.3.0 | Card: draw edge as non-layout inside stroke (fixes 2px oversize and inset photo) |
907148f |
2026-10-07 | 0.3.0 | Card: build from Figma 57:1648 (listing + stat) |