Reference generated from the custom elements manifest — 3 properties, 7 slots, 0 events.
CODE — HTML / REACT
Guidance
A bounded surface that groups one subject — its media, its heading, its body and its actions — so a page can present many of them side by side and the user reads each as one thing. It is a container with named regions, not a layout: a card decides what goes where inside itself and nothing about how cards sit next to each other.
WHEN TO USE
- You are showing a repeated set of objects — projects, jobs, articles, people — where each entry has its own actions.
- A block of content needs to be visually separated from the page around it.
variant="bare"keeps the regions and drops the background, shadow and radius. - Cards sit in a grid or a stretched row and their footers should line up. Set
filland every card in the row shares one height.
WHEN NOT TO USE
- You only need to arrange boxes with spacing between them. Cards are a content container; the arrangement around them belongs to the layout primitive.USE LAYOUT →
- The content is a single number with a label and a trend. That has its own component, with the typography and the delta treatment already decided.USE STAT →
- You are showing rows of comparable fields that the user will scan down a column. A card per row destroys the comparison a table makes easy.USE TABLE →
- There is nothing to separate — one card holding the whole page adds a border and no meaning.USE LAYOUT →
DO
- Use
fillrather than an inlineheight: 100%from the page.:hostisdisplay: contents, so a height written on<al-card>from outside is dropped entirely — this property exists because one app hit exactly that and worked around it at 25 call sites. - Put the primary action in
actions-end, which is the canonical bottom-right position, and a secondary one inactions-start. - Use the
imageslot for media above the heading, including an avatar — that is the common case across the example apps. - Reach for
layout="inline"when the media and the text should sit side by side rather than stacked.
DON’T
- Don't slot content into
action-right. The slot is documented on the component but the template renders no<slot name="action-right">, so anything assigned to it does not appear. Put an overflow control inactions-enduntil that is fixed. - Don't expect
imageto bleed to the card edge. The card carries a single outer padding and the image region neither resets nor negates it. A card that needs edge-to-edge media wants a component that renders it, not a flag here. - Don't make the whole card a link when it also contains buttons. Nested interactive regions leave the user with no way to tell which target they are about to hit.
- Don't hand-roll a grid of cards with flex or grid in your own stylesheet. That is what the layout primitive's
gridandbentovariants are for.
ACCESSIBILITY IN PRACTICE
- The card renders a plain
<div>with no landmark or list semantics. If a set of cards is a list, the surrounding markup has to say so — the card will not. - Put a real heading in the
headerslot. The card provides the visual grouping; the heading is what gives a screen-reader user a way to navigate between cards. - Each action inside a card needs a label that makes sense out of context. Ten cards each containing "View" produce ten identical entries in a list of links.
CONTENT GUIDELINES
- Lead with what distinguishes this card from the one beside it. The shared parts — the category, the label, the icon — are the least useful words in the first line.
- Keep body text to what survives being scanned. A card is read in a grid, at a glance, alongside others.
- Keep action labels consistent across every card in a set, so the row reads as one pattern rather than as variations.
WHERE THIS CAME FROM
libs/al-web-components/components/card/card.tsThe recorded correction about the `image` slot — the docs previously claimed edge-to-edge media and the code never did that.libs/al-web-components/components/card/card.tsWhy `fill` has to be a property: `display: contents` means a height set from outside never applies.libs/al-web-components/components/card/card.tsThe slot is declared in the component's documentation; the render function below it emits no matching slot element.AGENTS.mdThe rule that keeps arrangement out of content components like this one.
Each line above names a file and a literal string that must still appear in it.pnpm gate:guidance re-reads them from this built page, so guidance that has stopped being true fails a check rather than misleading you.
FIGMA PARITY
The component changed since the last confirmed sync — the Figma set is behind.
- DECIDED BY
- NEVER SYNCED
- FIGMA SIDE
- OBSERVED
- LAST CONFIRMED SYNC
- NEVER
- PUBLIC SURFACE
- 3 ATTR · 7 SLOT · 0 EVENT · 0 PART
The two sides have never been confirmed equal, so there is no baseline to compare against.
ACCESSIBILITY
The CI gate disables color-contrast globally (libs/al-web-components/story-fixture/src/main.ts), so its result never reaches a test run. It is enabled for this measurement, and reported here whichever way it comes out.
NO CONTRAST VIOLATIONS ACROSS THIS COMPONENT’S 6 STORIES.
INSTALL
import '@southleft/al-web-components/components/card';
import { ALCard } from '@southleft/al-react';API — 3 PROPS
SLOTS
EVENTS
THIS COMPONENT DECLARES NO EVENTS IN THE MANIFEST.
SOURCE — components/card/card.ts · Molecules/Card