Components

Card

A server-safe React card with a Liquid Glass surface, header, body, and footer.

Card is a native layout primitive: it has no interactive state and forwards its remaining native props, including style, to the root div. It is server-safe and does not support the render prop. Use ui to style the glass layers or any internal section.

Basic example

The card below is the real component, matching the code example.

Liquid glass
A CSS-only frosted glass panel.
Place the card over a detailed background to see the glass effect.

Content only

When title, description, or footer are omitted, the corresponding region is not rendered:

A card with only a body.

Accessibility

Card is a non-interactive container with no role or state of its own. Use a real heading for title, or add your own heading inside the body, so the card appears in the document outline.

When the whole card should be clickable, put one link or button in the title instead of adding a click handler to the root. See the accessibility guide for label guidance.

API reference

PropTypeDefaultDescription
titleReactNode—Card heading, rendered as a div.
descriptionReactNode—Supporting text below the heading.
footerReactNode—Footer action area.
childrenReactNode—Card body content.
refRef<HTMLDivElement>—Ref forwarded to the root element.
classNamestring—Merged into root; use it for layout.
styleCSSProperties—Inline styles merged into the same element as className.
ui{ root?: ClassValue; glass?: ClassValue; overlay?: ClassValue; layout?: ClassValue; header?: ClassValue; title?: ClassValue; description?: ClassValue; body?: ClassValue; footer?: ClassValue }—Tailwind classes for internal slots, keyed by data-slot.
AttributeDescription
data-slotMarks internal parts (root, glass, overlay, layout, header, title, description, body, footer) for styling.

Theming

The component uses the shared glass material. Tune shared --ui-glass-* tokens on a parent, use className for layout, and use ui for internal slots keyed by data-slot. Component-specific values live in src/theme/card.ts. See the theming guide for token layers and presets.

  • Accordion — For collapsible groups of content.
  • Tabs — For switching between card-sized views.
  • Scroll Area — When card content should scroll independently.