datui
Color scheme

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-foreground for filled custom badges (white by default).
  • Plain inline text with no role.
  • ContentBadge.IconSlot icons are aria-hidden; icon-only badges need aria-label.

API

ContentBadge

Small label pill for status or category, with optional `ContentBadge.IconSlot` icons.

PropTypeDefaultDescription
appearance(string & {}) | "accent" | "negative" | "positive" | "neutral" | "overlay"accentA named intent, or any CSS color (`#rrggbb`, `var(--x)`). Custom colors fill / tint 16% / outline per variant.
capsuleboolean—Fully rounded pill. Ignored at size `s`.
classNamestring—
sizeSizem
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.

PropTypeDefaultDescription
classNamestring—