All components

Badge

Data Display

A compact status label with solid, soft, outline, and accent variants. Drops an icon in cleanly.

SolidSoftOutline Shipped

Overview

A compact label for statuses, categories, and counts. Four variants cover the common emphasis levels, and an icon slots in cleanly to the left of the text.

When to use

Reach for solid or accent to call attention (a "New" or "Pro" tag), and soft / outline for quiet metadata like tags or categories. Keep the text to one or two words.

Composition

The badge forwards all native span attributes, so you can attach a title, role, or data attributes as needed. Drop any icon as the first child:

<Badge variant="accent"><Check /> Shipped</Badge>

Installation

Terminal
npx shadcn@latest add https://ui.saumyarex.xyz/r/badge.json

Props

PropTypeDefaultDescription
variant"solid" | "soft" | "outline" | "accent""soft"Visual style of the badge.
...propsReact.ComponentProps<"span">All native span attributes are forwarded.

Dependencies

class-variance-authorityclsxtailwind-merge