ComponentsMarkdown
Card
Group related content on a bordered --card surface with 16px corners and 24px padding. Compose CardHeader, CardTitle, CardDescription, CardContent, and CardFooter inside Card.
Live example
Token release 0.2.0
53 semantic tokens compiled across 4 brand themes.
Every surface and foreground pair passes WCAG 2.2 AA contrast in both dark and light modes.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| Card.elevation | "none" | "sm" | "md" | "lg" | "none" | Applies shadow-sm/md/lg in light mode or neutral step 6–7 border in dark mode. |
| CardTitle.as | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "h3" | Heading element level for document outline order. |
Sizes and tokens
| Tier / Role | Token | Value |
|---|---|---|
| Surface | --card / --card-foreground | Neutral step 3 background · step 12 text |
| Corner radius | --card-radius | radius-lg (16px) |
| Padding & gap | --space-6 | 24px outer padding and section gap |
| Elevation | --shadow-sm / --shadow-md / --shadow-lg | Light shadow or dark neutral step 6–7 border |
States
Elevation: none
Flat 1px border surface.
Elevation: sm
Uses shadow-sm token.
Elevation: md
Uses shadow-md token.
Elevation: lg
Uses shadow-lg token.
Code
import {
Button,
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@freshgemui/monoplinth";
export function Example() {
return (
<Card elevation="sm">
<CardHeader>
<CardTitle as="h2">Release 0.2.0</CardTitle>
<CardDescription>53 semantic tokens compiled.</CardDescription>
</CardHeader>
<CardContent>
<p>All contrast checks pass in dark and light modes.</p>
</CardContent>
<CardFooter>
<Button size="sm">Inspect</Button>
</CardFooter>
</Card>
);
}Do and don't
Do: Set CardTitle as to match the surrounding heading level
Use as='h2' inside main sections or keep the default h3 under an h2 heading so document outlines remain sequential.
Don't: Make the entire Card clickable or skip heading levels
Do not turn Card into a link or button container; place interactive buttons or links inside CardFooter or CardContent.
Accessibility
CardTitledefaults to<h3>and acceptsas(h1–h6) to preserve heading hierarchy.Carduses1px--borderand--cardsurface from the 30% band on--background(60% band).CardDescriptionpairs--muted-foreground(step 11) with--card(step 3) at>= 4.5:1contrast.
Rationale
Splitting Card into structural sub-components with uniform 24px padding and 16px corners enforces consistent surface hierarchy without custom spacing overrides.