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

Examples

Size

Small Card
This card uses the small size variant.

The card component supports a size prop that can be set to "sm" for a more compact appearance.

With image

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

API Reference

Card

Missing description.

Supports all div attributes.

CardHeader

Missing description.

Supports all div attributes.

CardTitle

Missing description.

Supports all div attributes.

CardDescription

Missing description.

Supports all div attributes.

CardAction

Missing description.

Supports all div attributes.

CardContent

Missing description.

Supports all div attributes.

CardFooter

Missing description.

Supports all div attributes.

Last updated on 6/4/2026