Prodular UI

Card

The one container for grouped content: a header, a body and an optional footer on a raised surface.

npx prodular-ui add card

Default

Header with an action, rows split by hairlines, and a footer with a top divider.

Team plan
Billed annually for the Halden workspace.
Active
Seats
18 of 25 used
Next invoice
$4,320.00 on Mar 14, 2027
Payment method
Visa ending 4242

Metrics

KPIs sit in one strip with vertical dividers, not in a grid of smaller cards.

Revenue
Last 30 days, compared with the previous period.
Monthly recurring revenue
$48,290+6.4%
Net revenue retention
112%+2.1%
Churned accounts
3-2

Small

size="sm" tightens the spacing for side panels and dense dashboards.

Deploy to production
Started by Priya Raman 4 minutes ago
main @ 8f3c21aBuilding

Anatomy

<Card>  <CardHeader>    <CardTitle>Team plan</CardTitle>    <CardDescription>Billed annually</CardDescription>    <CardAction>      <Badge variant="success">Active</Badge>    </CardAction>  </CardHeader>  <CardContent>...</CardContent>  <CardFooter>    <Button>Upgrade plan</Button>  </CardFooter></Card>

Guidance

Use it when

  • Group content that belongs together and is read or acted on as a unit: a plan, a chart, a settings section.
  • Put the single most relevant control for the card in CardAction, top right.
  • Use CardFooter for the actions that commit or leave the card. It always gets a top divider.

Avoid

  • Cards inside cards, or bordered and tinted boxes inside a card. Separate content with divide-y, border-t and spacing.
  • A grid of small cards for KPIs. Use one card with a divided strip.
  • Cards for every element on a page. If it has no header and no clear boundary, it probably does not need one.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Never nest Card inside Card. Inside a card, split sections with border-t or divide-y on the content.
  • Give every card a CardTitle. Add CardDescription only when it says something the title does not.
  • Place a Table directly in CardContent. The content drops its side padding and the table aligns its first and last columns with the card.
  • Use size="sm" for cards narrower than about 320px.
  • Do not override the card padding with p-* classes. The spacing comes from --card-spacing so density themes keep working.
  • Use size="xs" for dense surfaces such as map cards and inspector sections instead of overriding --card-spacing.
  • Use variant="plain" for a card-shaped section inside a surface that already is one.

API

CardHeader

PropTypeDefaultDescription
classNamestringAdd border-b to divide the header from the content. The bottom padding follows.

CardAction

PropTypeDefaultDescription
childrenReactNodeOne button, badge or menu, aligned to the top right of the header.

CardFooter

PropTypeDefaultDescription
childrenReactNodeActions. Rendered below a hairline divider.

Card

PropTypeDefaultDescription
size"default" | "sm" | "xs""default"Padding and gaps. xs is for inspectors, map cards and dense panels.
variant"default" | "plain""default"plain drops the border, background and shadow.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add card# or, with the registry in components.jsonnpx shadcn@latest add @prodular/card