Black Friday · Save 40% on Intent UI Design licenses with code UI2026.· 4 days left

Card

Loading...

Installation

Add the component with the CLI.

npx shadcn@latest add @intentui/card

Manual installation

Install the dependencies, then copy the component source into your project.

npm install cn

Anatomy

import {
  Card,
  CardAction,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
<Card>
  <CardHeader>
    <CardTitle>Card Title</CardTitle>
    <CardDescription>Card Description</CardDescription>
    <CardAction>Card Action</CardAction>
  </CardHeader>
  <CardContent>Card Content</CardContent>
  <CardFooter>Card Footer Button</CardFooter>
</Card>

Spacing

Use --card-spacing to control the card's vertical padding, the gap between sections, and the horizontal padding of its header, content, and footer. The default is --spacing(6).

<Card className="[--card-spacing:--spacing(4)] sm:[--card-spacing:--spacing(6)]">
  <CardHeader title="Users" />
  <CardContent>Card content</CardContent>
</Card>

Examples

With form

Place a form inside the card.

Loading...

Action

Add actions to the card header to align them to the right. This example uses a menu.

Loading...

With table

Use bleed and set the table's --gutter to var(--card-spacing) to align its columns with the card's padding.

Loading...

For table docs, check out the Table docs.

Section title

Use CardHeader on its own with withoutPadding to omit the default padding.

<CardHeader
  title="List Daemons"
  description="List of daemons to use in your sites."
/>

Component API

Card

Card extends the native <div> element.

classNamestring

CardAction

CardAction extends the native <div> element.

classNamestring

CardContent

CardContent extends the native <div> element.

classNamestring

CardDescription

CardDescription extends the native <div> element.

classNamestring

CardFooter

CardFooter extends the native <div> element.

classNamestring

CardHeader

CardHeader extends the native <div> element.

classNamestring
descriptionstring
titlestring

CardTitle

CardTitle extends the native <div> element.

classNamestring
Design