search⌘K

Card

Last Updated: September 2026

Cards group related content on a consistent surface with optional padding and elevation.

Anatomy

link
Dotted grid scale: 8px
  1. 1Surface
  2. 2Padding
  3. 3Children
  4. 4Render

Variants

link

Default

Padded surface for nested content.

Floating

Elevated card for overlays and popovers.

Without padding

withPadding={false} when children manage their own spacing.

With typography

Compose heading and body inside the default padded shell.

With actions

Pair content with Button for simple panels.

Usage Guidelines

link

When to use

  • •To group related content on a surface with consistent padding and elevation.
  • •As the shell for dialogs, popovers, and floating panels.
  • •When a bordered or floating container clarifies hierarchy.

When not to use

  • •For full-page layout — use page structure and Stack instead.
  • •When spacing alone is enough — avoid nesting cards inside cards.
  • •As a click target without clear interaction — prefer Button or Link.
checkDo

Use one Card to group a related block of content and actions.

closeDon't

Don't nest Cards inside Cards — hierarchy gets noisy.

checkDo

Use floating when the card sits above the page (overlays, popovers).

closeDon't

Don't make an entire Card the only interactive affordance without a clear control.

Behaviors

link

Surface options

  • •withPadding defaults to true (p-3). Set false for media, tables, or custom inset layouts.
  • •floating adds shadow-md for elevated panels.
  • •Border and background tokens are always applied; customize further with className.

Composition

  • •Card is a presentational div by default — put structure in children (Stack, Typography, Button).
  • •render can replace the root element when you need a semantic or polymorphic host.

Sizing

  • •Card grows with content; constrain width on a wrapper or via className.
  • •Prefer wrapping for fixed demo widths rather than inventing layout props.

Content Guidelines

link

Copy

  • •Lead with a short heading, then one supporting sentence.
  • •Use synthetic clinic/demo names only — no real patient or site PHI.

Density

  • •Keep padding consistent; if content needs flush edges, turn withPadding off once at the root.
  • •Avoid packing unrelated sections into a single card — split into separate surfaces.

Accessibility

link

Text & Labels

  • •Card itself is not interactive — put labels on headings and controls inside.
  • •If the card is a dialog surface, naming belongs on the dialog/modal title, not Card.

ARIA attributes

  • •Default root is a generic div with no special role.
  • •Do not add role="button" to Card; use Button or render a proper control.

Keyboard Support

  • •Non-interactive by default — Tab moves to focusable children only.
  • •Ensure actions inside the card are keyboard reachable in a logical order.

FAQs

link

When should I use withPadding={false}?

When children need flush edges — images, tables, or custom section padding. Otherwise keep the default.

What does floating do?

Adds a medium shadow for elevated surfaces. Pair with overlays/popovers; skip it for flat in-page panels.

Is Card a compound component?

No. There are no Card.Header / Card.Body exports — compose Typography, Stack, and Button as children.

link