배지 (Badge)
UI 요소에 대한 작은 숫자 값 또는 상태 설명자입니다.
사용 시기
배지는 일반적으로 눈길을 끄는 매력과 함께 알림 또는 사용자 아바타 근처에 나타나며 주로 읽지 않은 메시지 수를 표시합니다.
의도 (Intent)
배지의 시각적 의도 또는 색상 구성표입니다.
Primary Secondary Success Danger Warning Info
astro
<Badge intent="primary">Primary</Badge>
<Badge intent="secondary">Secondary</Badge>
<Badge intent="success">Success</Badge>
<Badge intent="danger">Danger</Badge>
<Badge intent="warning">Warning</Badge>
<Badge intent="info">Info</Badge> 변형 (Variants)
배지의 스타일 변형입니다. `solid`, `soft` 또는 `outline`을 사용하십시오.
Solid Soft Outline
astro
<Badge variant="solid" intent="primary">Solid</Badge>
<Badge variant="soft" intent="primary">Soft</Badge>
<Badge variant="outline" intent="primary">Outline</Badge> 크기
배지의 크기를 설정합니다.
Small Medium Large
astro
<Badge size="sm">Small</Badge>
<Badge size="md">Medium</Badge>
<Badge size="lg">Large</Badge> 모양
배지는 알약(기본값) 또는 둥근 모양과 같은 다양한 모양을 가질 수 있습니다.
Pill Rounded
astro
<Badge shape="pill">Pill</Badge>
<Badge shape="rounded">Rounded</Badge> 점 (Dot)
특정 수 없이 단순히 배지 점을 표시합니다.
astro
<Badge shape="dot" intent="primary" size="md" />
<Badge shape="dot" intent="success" size="md" />
<Badge shape="dot" intent="danger" size="md" />
<Badge shape="dot" intent="warning" size="md" />
<Badge shape="dot" intent="info" size="md" /> 독립형 / 알림
읽지 않은 개수와 같은 숫자 표시기에는 `notification` 모양을 사용하십시오.
3 +99
astro
<Badge shape="notification" intent="danger" variant="solid">3</Badge>
<Badge shape="notification" intent="primary" variant="solid">+99</Badge> 위치 지정
배지는 `position` 속성을 사용하여 부모 컨테이너를 기준으로 절대 위치에 지정할 수 있습니다.
9
astro
<div class="relative w-12 h-12 bg-zinc-200 dark:bg-zinc-800 rounded-md flex items-center justify-center">
<Badge position="top-right" shape="notification" intent="danger" variant="solid">9</Badge>
</div>
<div class="relative w-12 h-12 bg-zinc-200 dark:bg-zinc-800 rounded-md flex items-center justify-center">
<Badge position="bottom-right" shape="dot" intent="success" size="lg" />
</div> API
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| intent | The visual intent or color scheme of the badge. | "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "primary" |
| variant | The style variant of the badge. | "solid" | "outline" | "soft" | "soft" |
| size | The size of the badge. | "sm" | "md" | "lg" | "md" |
| shape | The geometric shape of the badge. | "rounded" | "pill" | "dot" | "notification" | "pill" |
| position | Positions the badge absolutely relative to its nearest positioned ancestor. | "top-right" | "bottom-right" | "top-left" | "bottom-left" | - |
| class | Additional CSS classes to apply to the badge. | string | - |