Draft. Ported from control-center’s Card and restyled with Beehexa tokens. Not yet approved; the API may still change.
A card is a bordered surface that groups the content and actions about one subject: a connection, a summary, a setting.
When to use
- Several things of the same kind side by side, such as connections or stores on a dashboard.
- A short summary with its actions: the status of a sync with Sync now and View history.
- Numbers on a dashboard, with
size="sm".
When not to use
- Around a whole page or form. The page is already the surface; a card adds an edge and nothing else.
- For rows of records with the same fields. Use a Table so people can compare them.
- For a single line with an action. Use an Item.
- Inside another card. Separate the parts with headings or a line instead.
Parts
| Part | Holds |
|---|---|
CardHeader |
CardTitle, CardDescription and an optional CardAction |
CardAction |
One small button or menu at the end of the header |
CardContent |
The body |
CardFooter |
The actions, on a quiet strip at the bottom |
Footer buttons follow the page form order (D10): left-aligned, the primary action first.
Sizes
| Size | Padding | Use |
|---|---|---|
default |
24 px (space.card) |
Most cards |
sm |
12 px (space.150) |
Dashboards and dense grids |
Tokens
| Part | Tokens |
|---|---|
| Surface | color.surface, border.width.default in color.border, elevation.shadow.raised |
| Corners | radius.card (8 px) |
| Padding and gaps | space.card, space.200 between parts; space.150 when small |
| Title | font.heading.small (font.heading.xsmall when small), color.text |
| Description | font.body.default, color.text.subtle |
| Footer | color.surface.subtle above a color.border line |