GitHub 560+

Card

Displays a card with header, content, and footer.

Create project
Deploy your new project in one click.

Card content goes here.

Installation

Command

npx shadcn@latest add @fulldev/card

Manual

  1. Copy and paste the card component files into your project.
  2. Update the import paths to match your project setup.

Usage

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>
    <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

Image

Add an image before the card header to create a card with an image.

Card image
Image Card
Card with media in the top slot.

The first child image automatically gets top rounding behavior.

API Reference

See the GitHub source code for more information on props.