Badge
다른 요소 위에 올려 상태나 개수를 표시하는 작은 배지 컴포넌트예요. 주로 카운트나 상태 인디케이터로 쓰여요.
출처: 문서
본문
Badge는 다른 요소를 위한 작은 상태 표시 인디케이터예요.
사용법 (Usage)
import { Badge } from '@primereact/ui/badge';
<Badge />
예제 (Examples)
기본 (Basic)
다른 요소 위에 올려서 개수나 상태를 나타내는 작은 오버레이예요.
심각도 (Severity)
severity 속성은 배지의 시각적 스타일을 정의해요.
크기 (Size)
size 속성을 사용하면 배지의 크기를 바꿀 수 있어요.
오버레이 (Overlay)
내용을 OverlayBadge 컴포넌트로 감싸면 어떤 요소든 배지를 추가할 수 있어요.
버튼 (Button)
버튼은 배지를 인라인으로 표시하는 기능을 기본 내장하고 있어요.
관련 자료 (Related)
하위 컴포넌트 (Sub-Components)
Badge와 OverlayBadge 컴포넌트 문서는 Primitive API에서 확인할 수 있어요.
훅 (Hooks)
useBadge 훅 문서는 Headless API에서 확인할 수 있어요.
접근성 (Accessibility)
WAI-ARIA 준수 상세와 키보드 지원은 Badge Primitive에서 확인할 수 있어요.
테마 (Theming)
CSS 클래스 (CSS Classes)
styled 모드에서 사용하는 클래스 이름 목록이에요.
| ClassName | Description |
|---|---|
| p-badge | Class name of the root element |
| ClassName | Description |
|---|---|
| p-overlaybadge | Class name of the root element |
디자인 토큰 (Design Tokens)
디자인 토큰 목록이에요.
| Token | CSS Variable | Description |
|---|---|---|
| badge.border.radius | --p-badge-border-radius | Border radius of root |
| badge.padding | --p-badge-padding | Padding of root |
| badge.font.size | --p-badge-font-size | Font size of root |
| badge.font.weight | --p-badge-font-weight | Font weight of root |
| badge.min.width | --p-badge-min-width | Min width of root |
| badge.height | --p-badge-height | Height of root |
| badge.dot.size | --p-badge-dot-size | Size of dot |
| badge.sm.font.size | --p-badge-sm-font-size | Font size of sm |
| badge.sm.min.width | --p-badge-sm-min-width | Min width of sm |
| badge.sm.height | --p-badge-sm-height | Height of sm |
| badge.lg.font.size | --p-badge-lg-font-size | Font size of lg |
| badge.lg.min.width | --p-badge-lg-min-width | Min width of lg |
| badge.lg.height | --p-badge-lg-height | Height of lg |
| badge.xl.font.size | --p-badge-xl-font-size | Font size of xl |
| badge.xl.min.width | --p-badge-xl-min-width | Min width of xl |
| badge.xl.height | --p-badge-xl-height | Height of xl |
| badge.primary.background | --p-badge-primary-background | Background of primary |
| badge.primary.color | --p-badge-primary-color | Color of primary |
| badge.secondary.background | --p-badge-secondary-background | Background of secondary |
| badge.secondary.color | --p-badge-secondary-color | Color of secondary |
| badge.success.background | --p-badge-success-background | Background of success |
| badge.success.color | --p-badge-success-color | Color of success |
| badge.info.background | --p-badge-info-background | Background of info |
| badge.info.color | --p-badge-info-color | Color of info |
| badge.warn.background | --p-badge-warn-background | Background of warn |
| badge.warn.color | --p-badge-warn-color | Color of warn |
| badge.danger.background | --p-badge-danger-background | Background of danger |
| badge.danger.color | --p-badge-danger-color | Color of danger |
| badge.contrast.background | --p-badge-contrast-background | Background of contrast |
| badge.contrast.color | --p-badge-contrast-color | Color of contrast |