Card

A versatile container for grouping related content.

Basic

A Card with CardHeader, CardContent, and CardFooter.

Project overview

A summary of the current project status.

Everything is on track. The next milestone is due at the end of the sprint.

<Card>
<CardHeader
  title="Project overview"
  description="A summary of the current project status."
/>
<CardContent className="mt-4">
  <p>Everything is on track. The next milestone is due at the end of the sprint.</p>
</CardContent>
<CardFooter className="mt-4">
  <Button variant="primary" size="sm">View project</Button>
  <Button variant="outline" size="sm">Dismiss</Button>
</CardFooter>
</Card>

With action

Pass a node to the action prop on CardHeader to render it in the top-right slot.

API usage

Requests in the last 30 days.

Live

12,430 requests — 99.9% uptime.

<Card>
<CardHeader
  title="API usage"
  description="Requests in the last 30 days."
  action={<Badge variant="success" dot>Live</Badge>}
/>
<CardContent className="mt-4">
  <p>12,430 requests — 99.9% uptime.</p>
</CardContent>
</Card>

Padding variants

Use the padding prop to control the card's internal spacing.

padding="none"

padding="sm"

padding="md" (default)

padding="lg"

<Card padding="none">…</Card>
<Card padding="sm">…</Card>
<Card padding="md">…</Card>
<Card padding="lg">…</Card>

Props

Card

PropTypeDefaultDescription
padding'none' | 'sm' | 'md' | 'lg''md'Internal spacing of the card
classNamestringAdditional Tailwind classes
childrenReactNodeCard content

CardHeader

PropTypeDefaultDescription
titlestringBold heading rendered inside the header
descriptionstringMuted sub-text below the title
actionReactNodeRight-aligned slot for buttons, badges, etc.
separatorbooleanfalseRenders a bottom border separator between header and body
classNamestringAdditional Tailwind classes
childrenReactNodeArbitrary content below title and description

CardContent

PropTypeDefaultDescription
classNamestringAdditional Tailwind classes
childrenReactNodeMain body content

CardFooter

PropTypeDefaultDescription
classNamestringAdditional Tailwind classes
childrenReactNodeFooter actions; laid out as a flex row with gap