Card
헤더, 콘텐츠, 푸터로 구성된 카드를 표시합니다.
설치
사용법
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>구성
다음 조합으로 Card:
Card
├── CardHeader
│ ├── CardTitle
│ ├── CardDescription
│ └── CardAction
├── CardContent
└── CardFooter예제
Size
size="sm" prop으로 Card를 작은 크기로 설정합니다. 작은 크기는 더 좁은 간격을 사용합니다.
Image
Add an image before the card header to create a card with an image.
RTL
RTL 지원을 활성화하려면 RTL 설정 가이드를 참고하세요.
API 참조
Card
The Card component is the root container for card content.
| 속성 | 타입 | 기본값 |
|---|---|---|
size | "default" | "sm" | "default" |
className | string | - |
CardHeader
The CardHeader component is used for a title, description, and optional action.
| 속성 | 타입 | 기본값 |
|---|---|---|
className | string | - |
CardTitle
The CardTitle component is used for the card title.
| 속성 | 타입 | 기본값 |
|---|---|---|
className | string | - |
CardDescription
The CardDescription component is used for helper text under the title.
| 속성 | 타입 | 기본값 |
|---|---|---|
className | string | - |
CardAction
The CardAction component places content in the top-right of the header (for example, a button or a badge).
| 속성 | 타입 | 기본값 |
|---|---|---|
className | string | - |
CardContent
The CardContent component is used for the main card body.
| 속성 | 타입 | 기본값 |
|---|---|---|
className | string | - |
CardFooter
The CardFooter component is used for actions and secondary content at the bottom of the card.
| 속성 | 타입 | 기본값 |
|---|---|---|
className | string | - |