Component guideEditable source

Badge

A compact label for status, category, or short metadata.

Original component docs
On this page8 sectionsBack to top

Use Badge for a short status or category, not a primary action. This implementation supports two variants. For a destination, the render element must contain the visible content.

Live preview
Loading preview...

#Installation

Complete the base setup, then use the CLI or copy the source:

npx shadcn@latest add https://neobrutal-ui.andongmin.com/r/badge.json

#Usage

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

export default function ProjectBadges() {
  return (
    <div className="flex flex-wrap gap-2">
      <Badge>Published</Badge>
      <Badge variant="neutral">Documentation</Badge>
      <Badge render={<a href="/docs">Read the guide</a>} />
    </div>
  );
}

#API reference

Prop / partPurposeDefault
variantdefault or neutraldefault
childrenShort visible label—
renderElement containing the badge contentspan
classNameSizing and layout—

The render element keeps its content and composes its event handlers, styles, and ref with the badge props using Base UI.

#Accessibility

Use readable status text rather than color alone. A decorative badge need not be focusable. An interactive badge must use a real link or button and retain a meaningful accessible name. For dynamically changing status, announce the relevant update in a suitable live region rather than marking every static badge as an alert.

#Examples

#Neutral

Loading preview...

#Additional examples

#With icon

Loading preview...