Skip to content
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

PropTypeDefaultDescription
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 / RoleTokenValue
Surface--card / --card-foregroundNeutral step 3 background · step 12 text
Corner radius--card-radiusradius-lg (16px)
Padding & gap--space-624px outer padding and section gap
Elevation--shadow-sm / --shadow-md / --shadow-lgLight 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

  • CardTitle defaults to <h3> and accepts as (h1–h6) to preserve heading hierarchy.
  • Card uses 1px --border and --card surface from the 30% band on --background (60% band).
  • CardDescription pairs --muted-foreground (step 11) with --card (step 3) at >= 4.5:1 contrast.

Rationale

Splitting Card into structural sub-components with uniform 24px padding and 16px corners enforces consistent surface hierarchy without custom spacing overrides.