Badge
Two shapes in one component: notification (count / dot anchored to a child) and label pill (standalone text tag).
Badge does two jobs depending on what props you pass. Pass `count` (or `dot`) + `children` to overlay a notification indicator in the top-right corner of that child. Pass `children` alone (no count, no dot) and Badge renders the children themselves as a coloured pill — useful for "ok", "new", "12" tags inline with text. Variants `primary` / `secondary` / `success` / `danger` choose the colour scheme in both modes.
Install
Pull from the workspace packages (already available if you ran pnpm add):
Examples
Notification (count / dot anchored to a child)
34299+
Standalone indicator:5
Label pill (children only)
1242ok!
Guidelines
✓
Use dot for "new" without a specific count.Counts that change rapidly are distracting; a dot is enough.
✕
Stack two Badges on the same element.Two corners clash visually — combine the state instead.