ui

Badge

A badge or a component that looks like a badge. Built with Base UI and Tailwind CSS. Copy-paste ready.

API Reference

Installation

Usage

You can use the render prop to make another component look like a badge. Here's an example of a link that looks like a badge.

Examples

Outline

A bordered badge with a transparent background — use for secondary or neutral status labels.

Secondary

A lower-contrast badge for supplementary metadata that shouldn't compete with primary content.

Destructive

A red badge for error states, failed operations, or items requiring immediate attention.

Info

A blue badge for informational or neutral status indicators.

Success

A green badge to confirm a completed action or a healthy status.

Warning

An amber badge to flag a potential issue that requires attention but is not yet blocking.

Error

Distinct from destructive — use the error variant for validation errors or system fault states.

Size Variations

Renders sm, default, and lg size options to show how the badge scales across different contexts.

With Icon

A leading icon reinforces the badge's meaning — common for status badges like "Verified", "Live", or "Error".

Renders the badge as an anchor element using the render prop, so the entire badge is a clickable navigation target.

With Count

A numeric badge used to show unread counts, pending items, or notification numbers alongside a label.

Status Dot Indicators

Online, Busy, Away, and Offline statuses each rendered with a small colored dot inside a semantically-colored badge, ideal for presence indicators in user lists.

Release Channel Tags

A set of four release channel labels — Stable, Beta, Experimental, and Deprecated — each using the appropriate semantic variant to communicate maturity level at a glance.

Plan Tier Badges

Subscription tiers (Free, Starter, Pro, Enterprise) displayed as badge-price rows inside a Frame, useful for plan comparison sections or upgrade prompts.

Notification Categories

A sidebar-style list of notification types (Messages, Mentions, Reviews) where each row uses a ghost button with a trailing badge showing the unread count.

Priority Labels in Task List

A task list where each row has a title, assignee, and a right-aligned priority badge (Urgent, High, Medium, Low) styled with the appropriate semantic variant.