Card

헤더, 콘텐츠, 푸터로 구성된 카드를 표시합니다.

로그인
이메일과 비밀번호를 입력해 로그인하세요.
examples/krds/card-demo.tsx
import { Button } from "@/components/ui/button"
import {
  Card,

설치

pnpm dlx shadcn@latest add https://krdscn.gwlee.kr/r/card.json

사용법

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를 작은 크기로 설정합니다. 작은 크기는 더 좁은 간격을 사용합니다.

소형 카드
좁은 공간에서 사용하기 적합한 소형 카드 예시입니다.

카드 컴포넌트는 size 속성으로 "sm"을 지정해 더 작은 형태로 사용할 수 있습니다.

examples/krds/card-small.tsx
import { Button } from "@/components/ui/button"
import {
  Card,

Image

Add an image before the card header to create a card with an image.

행사 안내 이미지
추천
디지털정부 정책 설명회
공공서비스 개선 사례와 디지털정부 추진 방향을 안내합니다.
examples/krds/card-image.tsx
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import {

RTL

RTL 지원을 활성화하려면 RTL 설정 가이드를 참고하세요.

تسجيل الدخول إلى حسابك
أدخل بريدك الإلكتروني أدناه لتسجيل الدخول إلى حسابك
examples/krds/card-rtl.tsx
"use client"

import * as React from "react"

API 참조

Card

The Card component is the root container for card content.

속성타입기본값
size"default" | "sm""default"
classNamestring-

CardHeader

The CardHeader component is used for a title, description, and optional action.

속성타입기본값
classNamestring-

CardTitle

The CardTitle component is used for the card title.

속성타입기본값
classNamestring-

CardDescription

The CardDescription component is used for helper text under the title.

속성타입기본값
classNamestring-

CardAction

The CardAction component places content in the top-right of the header (for example, a button or a badge).

속성타입기본값
classNamestring-

CardContent

The CardContent component is used for the main card body.

속성타입기본값
classNamestring-

CardFooter

The CardFooter component is used for actions and secondary content at the bottom of the card.

속성타입기본값
classNamestring-