Card

Displays a card with header, content, and footer sections.

Preview

Create project
Deploy your new project in one-click.

Your new project will be created with default settings.

Installation

Use the CLI to add this component to your project.

npx shadcn@latest add https://ui.nyxhora.com/r/card.json

Usage

tsx
32 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import {
  Card,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"

export const metadata = generateComponentMetadata({
    name: "Card",
    description: "Displays a card with header, content, and footer sections.",
    category: "Display",
});


export default function MyComponent() {
  return (
    <Card>
      <CardHeader>
        <CardTitle>Card Title</CardTitle>
        <CardDescription>Card Description</CardDescription>
      </CardHeader>
      <CardContent>
        <p>Card Content</p>
      </CardContent>
      <CardFooter>
        <p>Card Footer</p>
      </CardFooter>
    </Card>
  )
}

Examples

With Form

Account
Make changes to your account here.

Notification Card

Notifications
You have 3 unread messages.

Push Notifications

Send notifications to device.

Simple Card

Total Revenue

$45,231.89

Props

PropTypeDescription
CarddivThe root container component
CardHeaderdivContains the title and description
CardTitledivThe card title
CardDescriptiondivThe card description
CardContentdivThe main content area
CardFooterdivContains actions or additional info