Badge

A small pill for status, counts, or category labels. Seven color variants with a dot prefix by default, swappable for an icon or stripped of chrome entirely with the plain prop.

Variants

Each variant gets a small dot indicator at the start of the label, except outline.

Dark previewReplay previewOpen in new tab
Default
Info
Success
Warning
Destructive
Muted
Outline

Usage

Import the parts you need from the component's folder.

ts
import { Badge } from "@/components/ui/badge";

With icon

The withIcon prop swaps the dot for a default icon that matches the variant (info, success check, warning triangle, and so on).

Dark previewReplay previewOpen in new tab
Default
Info
Success
Warning
Destructive
Muted

Custom icon

Pass any hugeicons or lucide name to icon to override the default.

Dark previewReplay previewOpen in new tab
Published
Scheduled
Cancelled
Archived

Plain

plain removes the border, padding, and radius. Good inside tables or inline with body text.

Dark previewReplay previewOpen in new tab
Active
Pending
Failed
Synced

API Reference

Badge

PropTypeDefaultDescription
variant"default" | "info" | "success" | "warning" | "destructive" | "muted" | "outline""default"Color of the dot or icon, and the overall tone.
iconstring—Icon name (hugeicons/lucide). Replaces the dot and disables the default icon.
withIconbooleanfalseUse the default icon for the variant instead of the dot.
plainbooleanfalseStrip border, padding, and radius. Keeps only the dot or icon and the label.
asChildbooleanfalseMerge props onto the child element instead of rendering a span. Forwards to reka-ui Primitive.
asstring | Component"span"Element or component to render as. Forwards to reka-ui Primitive.
classstring—Extra classes, merged with cn().
SlotDescription
defaultBadge label content.