Data display
ContentBadge
Label pill for status or category, with optional icons.
import { ContentBadge, ContentBadgeIconSlot } from "datui";Playground
Beta
<ContentBadge variant="primary" appearance="accent" size="m" weight="2">Beta</ContentBadge>Examples
Variants and sizes
accentneutralpositivenegativecustom
accentneutralpositivenegativecustom
accentneutralpositivenegativecustom
STopLarge
Accessibility
- Custom colors are your responsibility: pick values that keep 4.5:1 text contrast in each theme, and set
--dt-content-badge-foregroundfor filled custom badges (white by default). - Plain inline text with no role.
ContentBadge.IconSloticons arearia-hidden; icon-only badges needaria-label.
API
ContentBadge
Small label pill for status or category, with optional `ContentBadge.IconSlot` icons.
| Prop | Type | Default | Description |
|---|---|---|---|
| appearance | (string & {}) | "accent" | "negative" | "positive" | "neutral" | "overlay" | accent | A named intent, or any CSS color (`#rrggbb`, `var(--x)`). Custom colors fill / tint 16% / outline per variant. |
| capsule | boolean | — | Fully rounded pill. Ignored at size `s`. |
| className | string | — | |
| size | Size | m | |
| variant | "primary" | "secondary" | "outline" | "primary" | |
| weight | "1" | "2" | "3" | "2" | Font weight, `1` boldest. |
ContentBadgeIconSlot
Icon inside a `ContentBadge`; sized by the badge. Dropped at size `s`. Decorative.
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — |