Card
A surface that groups a header, a body and a footer.
Installation
Needs the arene setup first.
Install the packages it imports:
Set up the token layer and the StyleX compiler, if you have not already. See
Installation, and copy states.ts from the same page
for the footer's tray. The card also needs interop.css, which pulls a leading
image to the top edge.
Paste this source into the file named in its title.
Change the @/ imports if your project uses different aliases.
Usage
Composition
CardHeader is a two-column grid. CardAction sits in the second column and
spans both rows, so a title and description stay to its left.
Size
Use size="sm" for a tighter inset and a title one step down.
Spacing
Set --arene-card-spacing to change the gap between sections and the inset of
every part at once.
Bleed content to the card's edges with a negative
margin-inline: calc(-1 * var(--arene-card-spacing)), then put the same value
back as padding to keep the text on the card's inset. When that content sits
above a footer, cancel the section gap less the footer's raised strip with
margin-block-end: calc(radius.xl - var(--arene-card-spacing)) on
CardContent.
This agreement covers the survey data held by the Noether Group, including raw responses, derived tables and the notebooks that analyse them.
You may use the data only for the study named in your application. Do not copy it to another workspace or share it with anyone outside the study.
Publications that use the data must cite the dataset by its DOI. Send a draft to the data steward at least two weeks before you submit it.
Image
Put an img first in the card. It runs to the top edge and its corners clip to
the card's radius.
API reference
Pass render to replace a part's element or compose it with another component.
Every part renders a div and takes xstyle and className alongside every
div attribute.
Card
| Prop | Type | Default |
|---|---|---|
size | "default" | "sm" | "default" |
xstyle | StyleXStyles | — |
className | string | — |
size sets --arene-card-spacing and --arene-card-title-size on the root.
Setting either directly overrides it.
CardHeader
A grid of 1fr auto, with a 0.25rem row gap. The second column collapses to
nothing without a CardAction.
CardTitle
Reads --arene-card-title-size at weight 500.
CardDescription
Muted text at the card's own size.
CardAction
Pinned to the header's second column and first row, spanning both rows.
CardContent
The card's inset, and nothing else. Vertical rhythm is the root's row gap.
CardFooter
A tray under the card's body. The body's bottom edge rounds over the tray with a hairline shadow. The footer draws that shadow itself, so the body needs no wrapper. It cancels the root's bottom padding, so put it last.
cardStyles
The style maps behind the component. Spread them onto any element.
| Key | What it is |
|---|---|
base | The surface: fill, ring, radius, shadow, rhythm |
sizes | default and sm, each a pair of variables |
header | The two-column grid |
title | The title's type |
description | The muted description |
action | The header's second column |
content | The body's inset |
footer | The tray, its raised strip and negative margins |
Data attributes
| Attribute | On | Effect |
|---|---|---|
data-slot="card" | the root | Where interop.css keys a leading image |
data-size | the root | Reflects the size prop |
data-slot="card-header" | the header | Targets the header from a parent |
data-slot="card-title" | the title | Targets the title from a parent |
data-slot="card-description" | the description | Targets the description from a parent |
data-slot="card-action" | the action | Targets the action from a parent |
data-slot="card-content" | the body | Targets the body from a parent |
data-slot="card-footer" | the footer | Targets the footer from a parent |
CSS variables
| Variable | On | Effect |
|---|---|---|
--arene-card-spacing | the root | The section gap and every part's inset. 16px, 12px at sm |
--arene-card-title-size | the root | The title's size. 16px, 14px at sm |