Card
Card는 유연한 컨테이너 컴포넌트예요. 헤더, 본문, 푸터를 구조적으로 담을 수 있어서, 어떤 콘텐츠든 정돈된 상자 안에 넣고 싶을 때 쓰는 기본기라고 보면 돼요.
출처: 문서
본문
사용법 (Usage)
import { Card } from '@primereact/ui/card';
<Card.Root>
<Card.Body>
<Card.Caption>
<Card.Title />
<Card.Subtitle />
</Card.Caption>
<Card.Content />
<Card.Footer />
</Card.Body>
</Card.Root>
예시 (Examples)
기본 (Basic)
헤더, 본문, 푸터를 갖춘 구조화된 콘텐츠용 컨테이너예요.
폼과 함께 (With Form)
Card, Card.Body, Card.Caption, Card.Title, Card.Subtitle, Card.Content, Card.Footer를 사용해서 간단한 카드를 만들 수 있어요.
고급 (Advanced)
Card.Header를 사용해서 이미지, 아바타 또는 다른 콘텐츠를 헤더에 배치할 수 있어요.
관련 문서 (Related)
서브 컴포넌트 (Sub-Components)
CardRoot, CardHeader, CardBody, CardCaption, CardTitle, CardSubtitle, CardContent, CardFooter 컴포넌트 문서는 Primitive API에서 확인하세요.
훅 (Hooks)
useCard 훅 문서는 Headless API에서 확인하세요.
접근성 (Accessibility)
WAI-ARIA 준수 세부사항과 키보드 지원은 Card Primitive에서 확인하세요.
테마 (Theming)
CSS 클래스 (CSS Classes)
styled 모드에서 사용하는 클래스 이름 목록이에요.
| ClassName | Description |
|---|---|
| p-card | Class name of the root element |
| p-card-header | Class name of the header element |
| p-card-body | Class name of the body element |
| p-card-caption | Class name of the caption element |
| p-card-title | Class name of the title element |
| p-card-subtitle | Class name of the subtitle element |
| p-card-content | Class name of the content element |
| p-card-footer | Class name of the footer element |
디자인 토큰 (Design Tokens)
디자인 토큰 목록이에요.
| Token | CSS Variable | Description |
|---|---|---|
| card.background | --p-card-background | Background of root |
| card.border.radius | --p-card-border-radius | Border radius of root |
| card.color | --p-card-color | Color of root |
| card.shadow | --p-card-shadow | Shadow of root |
| card.body.padding | --p-card-body-padding | Padding of body |
| card.body.gap | --p-card-body-gap | Gap of body |
| card.caption.gap | --p-card-caption-gap | Gap of caption |
| card.title.font.size | --p-card-title-font-size | Font size of title |
| card.title.font.weight | --p-card-title-font-weight | Font weight of title |
| card.subtitle.color | --p-card-subtitle-color | Color of subtitle |
| card.subtitle.font.size | --p-card-subtitle-font-size | Font size of subtitle |
| card.subtitle.font.weight | --p-card-subtitle-font-weight | Font weight of subtitle |
더 알아보기 (Learn more)
- Card 서브 컴포넌트의 세부 API를 Primitive 문서에서 살펴보세요.
- 헤더에 이미지나 아바타를 넣는 고급 레이아웃을 시도해 보세요.