Skip to content

Badge

A React source recipe with a span element and the public TIS Badge classes and tokens.

Design

Functional preview

Running with the React source recipe distributed through shadcn and based on Base UI.

Loading functional preview…

Anatomy

Active 1 2
1 Container (.ds-badge) — pill-shaped span with background color and border-radius.
2 Text — label content, 1-2 words.

Solid Variants

Brand Success Warning Error Info Neutral

Subtle Variants

Brand Success Warning Error Info Neutral

Token mapping

Tokens shown for the brand variant. Other color variants follow the same pattern with their respective color groups.

PropertyTokenCSS variable
bg (brand solid)semantic.brand.background.default--ds-brand-background-default
text (brand solid)semantic.brand.content-default--ds-brand-content-default
bg (brand subtle)semantic.toned.background.default--ds-toned-background-default
text (brand subtle)semantic.toned.content-default--ds-toned-content-default
padding-xcomponent.badge.padding-x.default--ds-badge-padding-x-default
padding-ycomponent.badge.padding-y.default--ds-badge-padding-y-default
gapcomponent.badge.gap.default--ds-badge-gap-default
border-radiuscomponent.badge.radius.default--ds-badge-radius-default
border-widthcomponent.badge.border-width.default--ds-badge-border-width-default
label font-sizecomponent.badge.label.font-size.default--ds-badge-label-font-size-default
label line-heightcomponent.badge.label.line-height.default--ds-badge-label-line-height-default
label font-weightcomponent.badge.label.font-weight.default--ds-badge-label-font-weight-default