Redpanda UIRedpanda UI
Components

Badge

Displays a badge or a component that looks like a badge.

Made by shadcn

Powered by

Installation

Loading component...

Usage

Badge has a two-axis API: a semantic tone for color crossed with a variant for emphasis. Both are optional — the default is a neutral, solid badge, and it renders as a rounded-full pill.

import { Badge } from "@/components/redpanda-ui/badge"
import { CheckIcon } from "lucide-react"

// Default (neutral tone, solid emphasis)
<Badge>Neutral</Badge>

// Semantic color via `tone`
<Badge tone="success">Live</Badge>
<Badge tone="destructive">Error</Badge>

// Emphasis via `variant` (solid | subtle | outline)
<Badge tone="info" variant="subtle">Draft</Badge>
<Badge tone="warning" variant="outline">Degraded</Badge>

// Sizes (sm | md | lg)
<Badge size="sm">Small</Badge>
<Badge size="lg">Large</Badge>

// Leading icon
<Badge tone="success" icon={<CheckIcon />}>Verified</Badge>

// As a link
<Badge tone="primary" variant="subtle" render={<a href="/tags/react">React</a>} />

// Disabled
<Badge disabled>Archived</Badge>

API

tone — semantic color

ToneUse for
neutralDefault, general-purpose labels
primaryPrimary actions and highlights
accentBrand-related, featured items
infoInformational status, pending states
successPositive status, completions
warningCaution, degraded states
destructiveErrors, critical issues

variant — emphasis

VariantDescription
solidFilled background, highest emphasis (default)
subtleSoft tinted background, low emphasis
outlineBorder only, lowest emphasis

Other props

  • sizesm (20px) · md (24px, default) · lg (32px). Icons auto-scale per size (12 / 14 / 16px).
  • disabled — renders the inactive appearance and sets aria-disabled.
  • icon — a leading icon, sized to the badge; composes with text children.
  • render — render as another element (e.g. a link or button) via Base UI's polymorphic render prop.

Examples

With icon

Loading component...

Sizes

Loading component...

Count / notification

Loading component...

Removable (filter chips)

Loading component...
Loading component...

Live status (announced)

Loading component...

When to use

Use Badge when:

  • Displaying status or state (Active, Pending, Complete)
  • Showing categories, tags, or metadata
  • Indicating counts or numbers
  • Creating filterable tags or labels

Don't use Badge when:

  • The content is long-form (use a label or text instead)
  • You need a real interactive control (use Button instead)
  • The information is primary, not supplementary
  • It would be the only way to convey critical information (pair it with text)

Deprecated variants

Before the two-axis API, Badge exposed a flat list of variant strings — a 10-color × 3-style matrix (base, -inverted, -outline) plus shadcn aliases. The secondary and simple color families and the default/ghost/link aliases were dropped from the recommended set.

DeprecatedReplacement
neutral / primary / accent / info / success / warning / destructivetone="…" (solid is the default)
*-inverted (e.g. success-inverted)tone="…" variant="subtle"
*-outline (e.g. neutral-outline)tone="…" variant="outline"
disabled / disabled-inverted / disabled-outlinedisabled prop
simple / simple-*tone="neutral" (subtle/outline as needed)
secondary / secondary-*tone="neutral" or tone="primary"
outline (generic)tone="neutral" variant="outline"
default / ghost / link (shadcn aliases)tone="neutral" / restyle as needed
Loading component...

BadgeGroup

When displaying multiple badges with overflow handling, use BadgeGroup instead of manually arranging badges:

import { Badge } from "@/components/redpanda-ui/badge"
import { BadgeGroup } from "@/components/redpanda-ui/badge-group"

// Shows: [React] [TypeScript] [Tailwind] [+1]
<BadgeGroup maxVisible={3}>
  <Badge>React</Badge>
  <Badge>TypeScript</Badge>
  <Badge>Tailwind</Badge>
  <Badge>Next.js</Badge>
</BadgeGroup>

Use BadgeGroup when:

  • Displaying a dynamic list of tags/badges
  • You need "+N more" overflow handling with a tooltip
  • Badge count may exceed available space

Credits

  • We take our inspiration from Shadcn UI for the badge component and style.

Recent changes

  • patchv1.2.0Pin shipped dependency floors to the version we develop against. Registry items now declare ranges like `^5.1.9` (the actual installed version) instead of collapsing to `^5.0.0`, so consumers start on the known-tested baseline while caret semantics still allow any compatible release within the same major.#133
  • minorv1.1.0Theme docs refresh, readability pass on semantic foregrounds, and consumer-facing Base UI regression fixes.#121
  • minorv1.0.0Post-Base-UI polish. Public API unchanged.#116
  • majorv1.0.0Migrate every Radix-based primitive to `@base-ui/react@^1.4.0` (Base UI).#114
  • minorv0.3.0Add theme-provider component to the registry with documentation and tests. Includes playground type improvements (export RegistryItem, remove as-const boilerplate) and docs site dark mode border color fix.#109
See full history →
Built by malinskibeniamin. The source code is available on GitHub.

On this page