Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Shadcn Card for React and Tailwind

A surface for a single subject: header, media, body, and footer.

Login to your account

Enter your email and check your inbox

Installation

bunx --bun shadcn@latest add https://kit.dev/r/card.json

Usage

import { GoogleIcon } from "@/components/icons/google";
import { Button } from "@/components/ui/button";
import {
  Card,
  CardAction,
  CardContent,
  CardFooter,
  CardHeader,
} from "@/components/ui/card";
import { Field, FieldLabel, FieldSet } from "@/components/ui/field";
import { Input } from "@/components/ui/input";
<div className="w-full max-w-sm">
  <Card className="w-full">
    <CardHeader
      description="Enter your email and check your inbox"
      title="Login to your account"
    >
      <CardAction>
        <Button variant="link">Sign Up</Button>
      </CardAction>
    </CardHeader>
    <CardContent>
      <FieldSet>
        <Field>
          <FieldLabel>Email</FieldLabel>
          <Input placeholder="[email protected]" type="email" />
        </Field>
      </FieldSet>
    </CardContent>
    <CardFooter className="flex-col">
      <Button className="w-full" size="lg">
        Send one-time code
      </Button>
      <Button className="w-full" size="lg" variant="outline">
        <GoogleIcon aria-hidden="true" />
        Login with Google
      </Button>
    </CardFooter>
  </Card>
</div>

Accessibility

KeyDescription
Enter
Activate the focused control.
Space
Activate the focused control.

Demos

As Child

Custom Spacing

Icon

Product

Title Components

API Reference

Card

div

PropType
AttributeType
CSS variableType

CardMedia

div

PropType
AttributeType

CardHeader

div

PropType
AttributeType
CSS variableType

CardTitle

h2

PropType
AttributeType

CardDescription

p

PropType
AttributeType

CardAction

div

PropType
AttributeType

CardContent

div

PropType
AttributeType
CSS variableType

CardFooter

div

PropType
AttributeType
CSS variableType