Components · Labels & Badges
Badge
Small status indicator or label. Communicates state, category, or count.
import { Badge } from '@nexub/react';Usage
Labelling a status, category, or tag on an item
Showing a count or numeric indicator alongside an element
Highlighting new, featured, or updated content
Communicating a stage in a workflow (draft, published, archived)
Interactive filtering — use FilterChip or Chip instead
Long text labels that exceed 2–3 words
Critical alerts requiring user action — use Alert or Toast
Replacing a button — badges are non-interactive by design
Playground
Playground
Live<Badge variant="soft" tone="neutral">Badge</Badge>Examples
Tones
Variants
With leading dot
Agent badge
AgentBadge (12.2, beta) labels an AI agent in a chat header ("AI on your own key", "Buttons only"): a soft Badge with a leading sparkle. Pair it with `AgentAvatar`.
States
- Active
default - Active
size="sm" - Active
size="md" - Active
size="lg" - Active
variant="solid" - Active
variant="outline" - Active
variant="soft" - Active
tone="neutral" - Active
tone="info" - Active
tone="success" - Active
tone="warning" - Active
tone="danger" - Active
tone="leap" - Active
tone="bookub" - Active
tone="payub"
Variant matrix
| tone ↓ / variant → | solid | soft | outline |
|---|---|---|---|
| success | Badge | Badge | Badge |
| danger | Badge | Badge | Badge |
| warning | Badge | Badge | Badge |
| info | Badge | Badge | Badge |
| neutral | Badge | Badge | Badge |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | 'solid' | 'outline' | 'soft' | 'solid' | Visual fill style. |
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'leap' | 'bookub' | 'payub' | 'founderub' | 'neutral' | Semantic color tone. |
| size | 'sm' | 'md' | 'lg' | 'md' | Badge size. |
| leadingIcon | React.ReactNode | — | Icon or dot rendered before the label. |
| AgentBadge icon | React.ReactNode | — | AgentBadge (12.2, beta): the leading icon. Default: a sparkle. AgentBadge is always variant="soft" and takes Badge's tone, category and size. |
| category | 'accent' | 'blue' | 'amber' | 'emerald' | 'pink' | 'violet' | 'cyan' | 'red' | 'lime' | — | 10.3: a category colour for tags and labels (e.g. one per project or team). Wins over tone. It carries no meaning by itself: status still uses tone. |
| count | number | — | A number to show. Above max it reads "99+"; screen readers get the full number. |
| dot | boolean | — | A status dot. Before the label when there is one; on its own (no children or count) it is just the dot: give it an aria-label, or it's decorative. |
| max | number | 99 |
Design tokens
Badge reads these component tokens. Each one is unset by default and falls back to the semantic role it aliases, so nothing changes until you set it. Set one on any element to restyle every Badge below it, and leave the roles other components share alone. See the three token tiers.
| Token | Aliases | Notes |
|---|---|---|
| --badge-radius | --shape-control | — |
/* One area of your app */
.checkout {
--badge-radius: var(--shape-field);
}Accessibility
ARIA roles
Keyboard
- —
Badges are non-interactive and have no keyboard handlers.
Focus
Skipped in tab order. Decorative — never trap focus on a Badge.
Screen reader
Reads as inline text. For live status changes, wrap in an element with `role="status"` and `aria-live="polite"`.
Notes
For interactive equivalents (filtering, dismissing) reach for `Chip` or `FilterChip`.
On iOS & Android: Badge
import { Badge } from '@nexub/react-native';
<Badge tone="success" variant="soft" dot>Paid</Badge>Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Sizes | sm, md, lg. | sm, md. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
Badge props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | string | number | — | — |
| tone | ToneValue | 'neutral' | — |
| variant | 'solid' | 'soft' | 'outline' | 'soft' | — |
| size | 'sm' | 'md' | 'md' | — |
| dot | boolean | — | A status dot before the label (replaces web StatusPill). |
| count | number | — | A number to show. Above max it reads "99+"; screen readers get the full number. |
| max | number | 99 | — |
| leadingIcon | React.ComponentType<NativeIconProps> | — | — |
| category | CategoryColor | — | A category colour for tags and labels (one per project or team). Wins over tone. |