Demos

A header and content.

Usage

Use a card to group one result, one appointment, or one summary so it reads as a unit. Do not nest cards. If everything on a page is a card, nothing stands out.

Import it from @workspace/ui/components/card.

Anatomy

  • Card — The surface. size sets the inner spacing.
  • CardHeader — Holds the title, description, and action.
  • CardTitle — The card heading.
  • CardDescription — Muted supporting text under the title.
  • CardAction — Sits at the top right of the header.
  • CardContent — The main body.
  • CardFooter — Actions at the bottom. Add border-t for a divider.

Notes

  • An image placed first inside Card runs to the top edge with rounded corners.
  • Add border-b to CardHeader to separate it from the content.
  • Keep one primary action per card.

Examples

CardAction sits at the top right of the header. CardFooter holds the card's actions.

Small

Set size="sm" for tighter padding in lists and dashboards.

Props

These are the props you set most often. Unlisted props pass through to the underlying element.

Card

PropTypeDefaultDescription
size"default" or "sm"defaultInner spacing of the card.
classNamestring—Classes merged onto the element.