Skip to content

Card

Displays a card with header, content, and footer.

Create project

Deploy your new project in one click.

Install

Bash
npx @madeui/cli add card

Usage

TSX
import {
  Card,
  CardAction,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from '@/components/ui/card';

Composition

TSX
<Card>
  <CardHeader>
    <CardTitle />
    <CardDescription />
    <CardAction />
  </CardHeader>
  <CardContent />
  <CardFooter />
</Card>

Action

CardAction pins a slot (typically a button) to the top-right of CardHeader, spanning the title and description rows.

Notifications

You have 3 unread messages.

New comment on your pull request.

Small

Set size="sm" on Card for tighter padding across the header, content, and footer.

Compact card

Tighter padding for dense layouts.

API reference

Card

PropTypeDefaultDescription
size'md' | 'sm''md'sm tightens the padding shared by CardHeader, CardContent, and CardFooter.
styleStyleXStyles—StyleX styles merged last — always win over the component’s own styles.

Styling

CardHeader, CardTitle, CardDescription, CardAction, CardContent, CardFooter accept style (StyleXStyles, merged last so caller overrides always win) plus all native props of the element they render.

Was this page helpful?