For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
43
Sponsor

Card

Displays a card with header, content, and footer.

Sign in to your account
Enter your email below to sign in to your account.
import { Button } from "@/components/ui/button";
import {
  Card,
  CardAction,
  CardContent,
  CardDescription,

Installation

$ pnpm dlx shadcn@latest add https://shadcn-cssinjs.com/r/card.json

Usage

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

Composition

Use the following composition to build a Card:

Card
├── CardHeader
│   ├── CardTitle
│   ├── CardDescription
│   └── CardAction
├── CardContent
└── CardFooter

Examples

Size

Use the size="sm" prop for a more compact card.

Scheduled reports
Weekly snapshots. No more manual exports.
  • Choose a schedule (daily, or weekly).
  • Send to channels or specific teammates.
  • Include charts, tables, and key metrics.
import { ChevronRightIcon } from "lucide-react";

import { Button } from "@/components/ui/button";
import {
  Card,
  CardContent,

Spacing

Customize card spacing by setting the --card-spacing variable.

Login to your account
Enter your email below to login to your account
"use client";

import { useState } from "react";

import { Button } from "@/components/ui/button";
import {

Image

Add an image to the top of the card.

Event cover
Featured
Design systems meetup
A practical talk on component APIs, accessibility, and shipping faster.
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
  Card,
  CardAction,
  CardDescription,

RTL

To enable right-to-left support, see the RTL guide.

تسجيل الدخول إلى حسابك
أدخل بريدك الإلكتروني أدناه لتسجيل الدخول إلى حسابك
"use client";

import * as React from "react";

import { useTranslation } from "@/components/language-selector";
import type { Translations } from "@/components/language-selector";

API Reference

Card

The Card component is the root container for card content.

PropTypeDefault
classNamestring-

CardHeader

The CardHeader component is used for a title, description, and optional action.

PropTypeDefault
classNamestring-

CardTitle

The CardTitle component is used for the card title.

PropTypeDefault
classNamestring-

CardDescription

The CardDescription component is used for helper text under the title.

PropTypeDefault
classNamestring-

CardAction

The CardAction component places content in the top-right of the header (for example, a button or a badge).

PropTypeDefault
classNamestring-

CardContent

The CardContent component is used for the main card body.

PropTypeDefault
classNamestring-

CardFooter

The CardFooter component is used for actions and secondary content at the bottom of the card.

PropTypeDefault
classNamestring-