Rime

Card

A solid card with a washed header, a lifted highlight tone, and a sunken muted tone.

Card is a solid surface for content that should not show the field through it: summaries, forms, record details. default is a solid card with a washed header; highlight lifts the one block that needs action (white, a crisp brand hairline, a soft lift and a faint top rule); muted is a sunken box for secondary information.

It sets data-surface="solid", so secondary buttons inside become white tiles, and publishes --card-pad and --inner-radius to its content.

Two ways to fill it, rendering identically: props (title, description, actions, footer) or shadcn's parts (CardHeader, CardTitle, CardDescription, CardAction, CardContent, CardFooter). With parts, the children render bare and the parts give the structure.

Installation

npx shadcn@latest add KezLahd/rime/card

Also installs: base.

Usage

import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui";

<Card title="This month" description="Updated hourly" actions={<Button size="sm" variant="secondary">Export</Button>}>…</Card>

Composition

Card
├── CardHeader
│   ├── CardTitle
│   ├── CardDescription
│   └── CardAction
├── CardContent
└── CardFooter

Examples

Tones

This month

Updated hourly

32 invoices paid

Two invoices are overdue

Send a reminder or mark them paid.

Secondary information sits in a sunken box.

Composed from parts

The same card written with shadcn's parts; it renders identically to the props form below it.

This month

Updated hourly

32 invoices paid

This month

Updated hourly

32 invoices paid

API

Generated from the component's TypeScript types and JSDoc (scripts/gen-ui-registry.mjs), so it always matches the source.

Card

Card props
PropTypeDefaultDescription
titleReactNode
descriptionReactNode
actionsReactNodeRight side of the header: buttons, a status pill.
footerReactNode
tone"default" | "highlight" | "muted""default"default = solid card with a washed header. highlight = lifted white panel with a soft brand top edge, for the one block on a screen that needs the user's action. muted = sunken neutral box for secondary information.
padding"sm" | "md" | "lg""md"
as"div" | "section" | "article" | "aside""section"
headingLevel2 | 3 | 43

Also accepts the native attributes of AriaAttributes, DOMAttributes, HTMLAttributes.

CardHeader

CardHeader props
PropTypeDefaultDescription

Also accepts the native attributes of AriaAttributes, DOMAttributes, HTMLAttributes.

CardContent

CardContent props
PropTypeDefaultDescription

Also accepts the native attributes of AriaAttributes, DOMAttributes, HTMLAttributes.

CardFooter

CardFooter props
PropTypeDefaultDescription

Also accepts the native attributes of AriaAttributes, DOMAttributes, HTMLAttributes.

Theme tokens

Per-component tokens are undeclared by default, so the default shown is the fallback the CSS uses. Set one at :root (or in theme.css) to restyle every instance. Live values are read from this page, so they follow the Rime Studio.

Card per-component tokens
TokenDefaultLive value
--card-bgvar(--surface-solid)…
--card-bordervar(--line)…
--card-header-bglinear-gradient(to right, var(--surface-sunken), var(--surface-sunken-2))…
--card-pad-lgcalc(24px * var(--density))…
--card-pad-mdcalc(20px * var(--density))…
--card-pad-smcalc(14px * var(--density))…
--card-radiusvar(--r-xl)…
--card-shadowvar(--shadow-hairline-card)…

System tokens it reads

Card system tokens
TokenDefaultLive value
--border-wtokens.css…
--densitytokens.css…
--font-bodytokens.css…
--highlight-edgetokens.css…
--highlight-glowtokens.css…
--highlight-linetokens.css…
--ink-headingtokens.css…
--ink-mutedtokens.css…
--linetokens.css…
--line-glasstokens.css…
--line-softtokens.css…
--r-2xstokens.css…
--r-xltokens.css…
--shadow-hairline-cardtokens.css…
--shadow-lifttokens.css…
--surface-solidtokens.css…
--surface-sunkentokens.css…
--surface-sunken-2tokens.css…
--text-card-titletokens.css…
--text-smalltokens.css…

Accessibility

  • The title renders as h3 by default; set headingLevel to fit the page outline.

Do and don't

Do

  • Use highlight once per screen at most.

Don't

  • Don't tint a card to make it stand out; lift it (tone="highlight").

For AI agents

This page as markdown, rendered from the same registry entry. Point an agent at it (or add .md to this page's URL), or at /llms.txt for the index.

Open card.md