Home Components Badge
React Badge Components
24 free React badges built with Tailwind CSS and shadcn/ui conventions. Copy the code or install with the shadcn CLI. Great for status labels, counters, and tags.
Badge 1 : Solid badge in the primary color using the default shadcn badge variant.Badge 2 : Muted label using the secondary variant for low-emphasis tags and metadata.Badge 3 : Bordered label using the outline variant with a transparent background.Badge 4 : Solid badge with small rounded corners instead of the default full pill shape.Badge 5 : Larger solid badge with extra horizontal and vertical padding for more prominence.Badge 6 : Compact solid badge with slightly increased padding for small text labels.Badge 7 : Ghost badge with a small primary colored dot in front of the label.Badge 8 : Red badge using the destructive variant for errors or removal states.Badge 9 : Square-cornered numeric badge with tabular figures for showing counts.Badge 10 : Solid badge with a leading star icon, suited to GitHub star labels.Badge 11 : Dismissible tag with a small close button that removes the badge on click.Badge 12 : Soft sky blue status pill with a dot indicator labelled In Progress.Badge 13 : Soft red status pill with a dot indicator labelled Cancelled.Badge 14 : Clickable link badge with an arrow that slides right on hover.Badge 15 : Soft green status pill with a dot indicator labelled Done.Badge 16 : Outline badge with a small square logo image beside the brand name.Badge 17 : Sky blue outlined status tag with an alert icon labelled Pending.Badge 18 : Green outlined status tag with a filled check circle labelled Done.Badge 19 : Red outlined status tag with a ban icon labelled Error.Badge 20 : Plain badge wrapped in an orange to fuchsia gradient border ring.Badge 21 : Badge filled with an orange, rose and fuchsia linear gradient and white text.Badge 22 : Toggleable chip that switches from outline to secondary with a green check when selected.Badge 23 : Square cart icon tile with a numeric count badge pinned to its top right corner.Badge 24 : Avatar with a green online status dot on its bottom right corner.
About React Badge Components A React badge is a small inline label for a status, count, or category, such as New, Paid, or 3 unread. Watermelon UI badges are built with Tailwind CSS and class-variance-authority, with variants like default, secondary, destructive, and outline, and an asChild option to render them as links. Add one with the shadcn CLI, then change the variant classes to fit your palette.
When to use it Status labels in a table row, like Active, Pending, or Failed. Tags or categories on a card or blog post. Notification counts next to a nav item or icon. When to use something else Use Button when the label needs to trigger an action when clicked. Use Alerts when the message needs a sentence of explanation, not one or two words. Use Avatar when you are representing a person or account rather than a status. Frequently asked questions How do I make a shadcn badge a link? Use asChild and put an anchor or Next.js Link inside the Badge. The badge styles are passed to the child element instead of rendering a span.
How do I add a custom color to a shadcn badge? Add a new key to the variant object in badgeVariants, or pass Tailwind classes through className for a one-off. A new variant keeps the color reusable and typed.
Can I put an icon inside a badge? Yes. Place a small icon before or after the text inside the Badge, and the built-in classes size and space it. Keep icons decorative or give them an aria-label.
How do I change the size of a shadcn badge? Pass Tailwind classes through className, for example className="h-6 px-3 text-sm", because the badge has a fixed h-5 height and no size prop. For sizes you reuse, add a size key to badgeVariants next to variant.
How to use React Badge Components Start from a React project with Tailwind CSS and shadcn/ui set up. Next.js, Vite, Remix, and Astro all work. Run npx shadcn@latest add https://registry.watermelon.sh/r/badge-1.json to add the source files to your project. Import it where you need it, then edit the Tailwind classes and design tokens to match your product. Dependencies installed with it: react-icons.
The code is yours: it lives in your repository, so there is no runtime package to keep updated. Watermelon UI is free and open source under the MIT license.
More: Free React components , UI library alternatives , guides .