Skip to content
Mosaic
On this page

Badge

A small label that marks nearby content with a status or category. Renders a span, or the render element, and forwards its ref.

ActivePendingExpiredDraft

Use for

  • a status label such as Active or Failed
  • a category or role tag next to a name
  • a "New" marker

Practices

GuidancePractice
DoPick color by meaning: positive for success, negative for failure, warning for attention.
DoPass render to make a badge a link, such as render={<a href="/billing" />}.
Don’tUse a badge for a message the user must read. Use Banner instead.

API reference

Badge

The label. color defaults from BadgeContext when a parent sets it.

Slot: cl-badge

PropTypeDescription
color'primary' | 'neutral' | 'warning' | 'negative' | 'positive'primary, neutral, warning, negative or positive.Default: 'primary'

Examples

A status

TSX
<Badge color='positive'>Active</Badge>

As a link

TSX
<Badge render={<a href='/billing' />}>Upgrade</Badge>