Skip to content

Feedback

Badge

tsx
import { Badge } from "@cherry-design-system/react";

export function DeployStatus() {
  return (
    <Badge variant="success" dot>
      Live
    </Badge>
  );
}

A Badge is a static status pill: a short label such as "Live", "Beta" or "Failed". For a value the user can remove, use Tag instead.

Examples

Variants

tsx
import { Badge } from "@cherry-design-system/react";

export function Variants() {
  return (
    <>
      <Badge variant="neutral">Neutral</Badge>
      <Badge variant="accent">Accent</Badge>
      <Badge variant="primary">Primary</Badge>
      <Badge variant="outline">Outline</Badge>
      <Badge variant="success">Success</Badge>
      <Badge variant="warning">Warning</Badge>
      <Badge variant="danger">Danger</Badge>
      <Badge variant="info">Info</Badge>
    </>
  );
}

Sizes

tsx
import { Badge } from "@cherry-design-system/react";

export function Sizes() {
  return (
    <>
      <Badge size="sm">Small</Badge>
      <Badge size="md">Medium</Badge>
    </>
  );
}

With a status dot

The dot takes the text color of the variant.

tsx
import { Badge } from "@cherry-design-system/react";

export function Statuses() {
  return (
    <>
      <Badge variant="success" dot>Operational</Badge>
      <Badge variant="warning" dot>Degraded</Badge>
      <Badge variant="danger" dot>Outage</Badge>
    </>
  );
}

Properties

variant"neutral" | "accent" | "primary" | "outline" | "success" | "warning" | "danger" | "info"

Tone of the pill. Defaults to "neutral".

size"sm" | "md"

Pill size. Defaults to "md".

dotboolean

Shows a leading status dot in the text color.

Badge renders a <span>, forwards its ref to it and passes every other <span> attribute through. It has no client JavaScript, so it is safe in Server Components.

Styling

HookValues
.cherry-badgeRoot element
data-variantneutral, primary, accent, outline, success, warning, danger, info
data-sizesm, md
.cherry-badge__dotThe leading dot

Status tones read the --cherry-success-*, --cherry-warning-*, --cherry-danger-* and --cherry-info-* tokens (bg, fg, border); primary and accent read --cherry-primary-* and --cherry-accent-*.

Accessibility

A Badge is plain text: the label carries the meaning and the tone color only reinforces it. Write "Failed", not just a red pill. The dot is hidden from assistive tech.