Toggle Sidebar B
AppearanceLight & dark mode D

Card

A container with separate header, content, and footer slots. Useful for dashboard stats, list items, or any block that needs a visual boundary.

Default

Header with title and description, body in CardContent.

Replay preview

Create project

Deploy your new project in one click.

Pick a framework and a region. You can change either later from settings.

Small

Set size to sm on Card for tighter vertical padding and gaps — good for compact widgets.

Replay preview

Storage

8.2 GB of 15 GB used

Custom spacing

Override the default gap-8 on Card and the header gap with class props to tune the space between sections.

Replay preview

Notifications

Pick what you want to be notified about.

CommentsPush, Email
MentionsPush
Product updatesEmail

Edge to edge

Drop the horizontal padding with px-0 so a list or image runs flush to the card edges; each row adds its own inset.

Replay preview

Team members

Invite up to 5 people on the free plan.

Sofia Davissofia@example.com
Owner
Jackson Leejackson@example.com
Member
Isabella Nguyenisabella@example.com
Member

Image header

A leading media block as the first child sits flush to the top and sides; the card clips it with overflow-hidden.

Replay preview

Mountain retreat

A quiet cabin above the clouds.

Two nights, breakfast included. Free cancellation up to 24 hours before check-in.

Card grid

Common dashboard pattern: a row of stats cards in a responsive grid with gap-x-2 gap-y-6.

Replay preview

Total revenue

$45,231

+20% from last month

Subscriptions

2,350

+180 this week

Sales

12,234

+19% from last month

Active now

573

+201 since last hour

Anatomy

Import all parts and piece them together.

vue
<script setup>
import {
  Card,
  CardAction,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@/components/ui/card";
</script>

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

API Reference

Card

PropTypeDefaultDescription
size"default" | "sm""default"sm reduces vertical padding and the gap between sections for a compact card.
classstringExtra classes. Defaults already include rounded-xl, border, and bg-card.

CardHeader

PropTypeDefaultDescription
classstringTop container for title, description, and optional action.

CardTitle / CardDescription

PropTypeDefaultDescription
classstringTitle is font-semibold tracking-tighter. Description uses text-muted-foreground.

CardContent / CardFooter

PropTypeDefaultDescription
classstringBody and action area. Padding is preset.

CardAction

PropTypeDefaultDescription
classstringPlaced inside CardHeader; grid-positions an action (button, menu) to the top-right.