Card

A card groups related content and actions.

Login to your account
Enter your email below to login to your account
<Card className="w-full max-w-xs">
  <CardHeader>
    <CardTitle>Login to your account</CardTitle>
    <CardDescription>
      Enter your email below to login to your account
    </CardDescription>
    <CardAction>
      <Button variant="link">Sign Up</Button>
    </CardAction>
  </CardHeader>
  <CardContent>
    <form>
      <div className="flex flex-col gap-6">
        <TextField className="w-full">
          <Label htmlFor="email">Email</Label>
          <Input
            id="email"
            type="email"
            placeholder="m@example.com"
            required
          />
        </TextField>
        <TextField className="w-full">
          <div className="flex items-center">
            <Label htmlFor="password">Password</Label>
            <a
              href="#"
              className="ml-auto inline-block text-sm underline-offset-4 hover:underline"
            >
              Forgot your password?
            </a>
          </div>
          <Input id="password" type="password" required />
        </TextField>
      </div>
    </form>
  </CardContent>
  <CardFooter className="flex-col gap-2">
    <Button variant="primary" type="submit" className="w-full">
      Login
    </Button>
    <Button variant="default" className="w-full">
      Login with Google
    </Button>
  </CardFooter>
</Card>

Installation

npx shadcn@latest add @dotui/card

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>

Anatomy

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

CardHeader holds the CardTitle, CardDescription, and an optional CardAction pinned at the end of the header row. CardContent is the main body and CardFooter sits below it, usually for actions.

Size

Pass size="sm" to Card for a more compact card with tighter spacing.

<Card size="sm">{/* ... */}</Card>

Section borders

Add border-b to CardHeader or border-t to CardFooter to visually separate them from the content.

<CardHeader className="border-b">{/* ... */}</CardHeader>

Examples

Default

Default Card
This card uses the default spacing.

The card component provides a simple container with header, content, and footer sections.

Login Form

Login to your account
Enter your email below to login to your account

With Image

Event cover
Beautiful Landscape
A stunning view that captures the essence of natural beauty.

Meeting Notes

Meeting Notes
Transcript from the meeting with the client.

Client requested dashboard redesign with focus on mobile responsiveness.

  1. New analytics widgets for daily/weekly metrics
  2. Simplified navigation menu
  3. Dark mode support
  4. Timeline: 6 weeks
  5. Follow-up meeting scheduled for next Tuesday
CNLRER+8

API Reference

Card

A card groups related content and actions into a single container.

Supports all div attributes.

PropType

CardHeader

The header of the card. Contains the title, description, and an optional action.

Supports all div attributes.

PropType

CardTitle

The title of the card.

Supports all div attributes.

PropType

CardDescription

The description of the card, displayed below the title.

Supports all div attributes.

PropType

CardAction

An action displayed at the end of the card header, such as a button or link.

Supports all div attributes.

PropType

CardContent

The main content of the card.

Supports all div attributes.

PropType

CardFooter

The footer of the card, typically containing actions.

Supports all div attributes.

PropType

Last updated on 7/9/2026