mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-09 06:55:07 +00:00
52 lines
688 B
Plaintext
52 lines
688 B
Plaintext
---
|
|
title: Card
|
|
description: Displays a card with header, content, and footer.
|
|
component: true
|
|
---
|
|
|
|
<ComponentPreview name="card-demo" />
|
|
|
|
## Installation
|
|
|
|
<Steps>
|
|
|
|
### Command
|
|
|
|
```bash
|
|
npx shadcn-ui add card
|
|
```
|
|
|
|
### Usage
|
|
|
|
```tsx
|
|
import {
|
|
Card,
|
|
CardContent,
|
|
CardDescription,
|
|
CardFooter,
|
|
CardHeader,
|
|
CardTitle,
|
|
} from "@/components/ui/card"
|
|
```
|
|
|
|
```tsx
|
|
<Card>
|
|
<CardHeader>
|
|
<CardTitle>Card Title</CardTitle>
|
|
<CardDescription>Card Description</CardDescription>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<p>Card Content</p>
|
|
</CardContent>
|
|
<CardFooter>
|
|
<p>Card Footer</p>
|
|
</CardFooter>
|
|
</Card>
|
|
```
|
|
|
|
</Steps>
|
|
|
|
## Examples
|
|
|
|
<ComponentPreview name="card-with-form" />
|