MiHCM
data/@mihcm/ui·v0.21.0·stable

Badge

Small status / labelling pill. Six variants spanning informational, semantic, and outline.

Badge

A small status or labelling pill that composes inline with text.

When to use

  • Status indicators — active, pending, archived.
  • Category labels — tags on cards, filter chips.
  • Counts — unread messages, notification counts.

When NOT to use

  • For long descriptions — keep badge text to 1-2 words.
  • For interactive filters — use a toggle button or chip component.

Import

import { Badge } from '@mihcm/ui/Badge';

Basic usage

<Badge>Active</Badge>

Variants

VariantUse when
defaultPrimary status, the most prominent.
secondaryLower emphasis alongside a primary badge.
destructiveError or critical status.
successPositive outcome or active state.
warningCaution or pending state.
outlineMinimal, text-only with a border.

Composition

  • Badge renders a <span> so it sits inline with text and headings.
  • Pair with an icon as a child for added context: <Badge><CheckIcon className="size-3" /> Done</Badge>.
  • Alert — for longer messages with titles and descriptions.