# Upstage Design System — Badge (product)

- context: product · group: display
- source revision: lift-1.2.3 (Lift 1.2.3, zip sha256 8d5d9377c2b4…)
- status: content source-derived · availability implemented · verification static-only
- human docs: /ko/components/product/badge/ · machine doc: /agent/components/product/badge.md

## Required references (read these)
- /components/display/Badge.jsx — implementation · sha256 320b3c3d0c1c…
- /components/_types.d.ts — api · key BadgeProps
- /components/display/Badge.prompt.md — usage-note · sha256 cd4494c8c276…

## API (components/_types.d.ts BadgeProps)
- tone?: string (default gray) — Categorical: coral, skyblue, olive, purple, mint, magenta, teal, burgundy, green, gray, yellow — or state: success, warning, info, error
- variant?: "soft" | "solid" (default soft) — soft (tinted bg, default) or solid (neutral-900 badge tokens)
- children?: React.ReactNode
- style?: React.CSSProperties

## Unverified
- Browser behaviour is not verified here (static source check only).

## Usage note (original, MIX)

Small 4px-radius pill; tones come from the categorical `--accent-{name}-bg/fg` sets or state colors.

`tone="gray"` / `variant="soft"` → `--accent-gray-bg` / `--accent-gray-fg`.

Badge 기본값은 중립 회색이다. ‘새 기능’ 같은 일반 라벨은 별도 의미나 색상 요구가 없으면 기본값을 유지한다. 문구에 ‘새 기능’·‘혜택’·‘라벨’이 있다는 이유만으로 Highlight를 적용하거나 별도 강조 클래스를 만들지 않는다. 분류·상태가 명확하면 지원하는 tone을 선택한다. Highlight는 해당 context의 조건에 맞는 의도적인 정보 강조가 필요할 때만 사용하며, Badge의 기본값이나 tone을 대체하지 않는다.



정적 HTML에서도 같은 Badge 계약을 따른다. 아래 CSS는 기본 Badge의 색·치수를 옮긴 예시다. 분류·상태를 구현할 때는 구현 파일의 대응 토큰 쌍을 함께 사용하고, 기존 컴포넌트가 있으면 먼저 재사용한다.





| Contract | Background | Foreground |
|---|---|---|
| Default: `tone="gray"`, `variant="soft"` | `--accent-gray-bg` | `--accent-gray-fg` |
| Category: supported `tone`, `variant="soft"` | `--accent-{tone}-bg` | `--accent-{tone}-fg` |
| State: `success`, `warning`, `info`, `error` | `--state-{tone}-bg` | `--state-{tone}-fg` |
| `variant="solid"` | `--badge-default` | `--badge-default-foreground` |

All color pairs above use `hsl(var(--token))`, as in `Badge.jsx`.

## Examples (from the usage note)

```jsx
<Badge>새 기능</Badge>
<Badge tone="success">Active</Badge>
<Badge tone="purple">Beta</Badge>
<Badge variant="solid">Default</Badge>
```

```html
<span class="badge">새 기능</span>
```

```css
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  background: hsl(var(--accent-gray-bg));
  color: hsl(var(--accent-gray-fg));
}
```
