Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-badge

Badge

Free

A small pill with a word, an icon or a count, for a status, a tag or a label beside a title or in a row, for React and Tailwind CSS. Free, MIT.

Switch the variant (each status with its icon), change the words, add a count and change it to see only its changed digits move. Nothing is saved: the badge is drawn live from the panel.

When to use

  • A small pill with a word, an icon or a count, for a status, a tag or a label beside a title or in a row.
  • Also called: tag, chip or pill.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Badge on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

Terminal
npx shadcn@4.23.1 add @goop/trail-badge
PROMPT
Add the Goop Badge to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { Badge, BadgeIcon, BadgeLabel, BadgeValue } from '@/components/ui/goop/badge';

<>
  <Badge variant="success">
    <BadgeIcon icon="circle-check" />
    <BadgeLabel>Paid</BadgeLabel>
  </Badge>
  <Badge variant="warning">
    <BadgeLabel>Due</BadgeLabel>
  </Badge>
  <Badge variant="outline">
    <BadgeIcon icon="history" />
    <BadgeLabel>To sync</BadgeLabel>
    <BadgeValue>{3}</BadgeValue>
  </Badge>
</>
  • Fits: list, record: row.
  • In a Table, give a column of badges the track auto, never a guessed px width (a narrower track cuts a pill's words). In a grid of your own, an auto track is exactly the pill's width: give its cells pe-6.
  • height, width, padding, corner, background, shadow, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
variantdefault | outline | success | warning | destructive | info = default
asChild?boolean = falseRender the badge's look on the one child element instead of a span (a link, a button).
Parts
PartWhat it is
BadgeIconThe badge's leading icon; icon: IconName — A pack icon name
BadgeLabelThe status words in a Badge, after an optional BadgeIcon and before an optional BadgeValue
BadgeValueThe badge's count (<BadgeValue>{unread}</BadgeValue>, after its words or alone)
  • Class recipes (cva): badgeVariants (Badge)
  • data-slot values (to select a part by): badge, badge-icon, badge-label, badge-value, badge-value-item

Accessibility

  • hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
disabledthe prop disabled

Motion

  • The part sets its own motion: add no transition or animation of your own.
  • How the theme moves, and how to move your own parts the same way: Motion.

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/trail/components/badge.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-badge

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.