Badge

A small label used to display statuses, counts, or notifications.

Example

Usage

Installation

Install following dependencies:

npm install class-variance-authority clsx tailwind-merge @radix-ui/react-slot

Add cn helper using clsx and twMerge for conditional class merging in Tailwind components.

lib/utils.ts

Copy and paste the following code into your project.

components/ui/core/badge.tsx
npx libravelui@latest add badge

Anatomy

import { Badge } from "@/components/ui/core/badge";
<Badge tone="default">Default</Badge>
<Badge tone="secondary">Secondary</Badge>
<Badge tone="destructive">Destructive</Badge>
<Badge tone="outline">Outline</Badge>

Another Example

As Child

Displays different types of badges used to indicate status or categories with flexible styling that can be applied directly to other elements without adding extra DOM nodes.

Usage

Props

Loading types…

Accessible React component library to copy, customize, and own your UI. Built for Next.js, Vite, and Laravel.

Crafted by dervyon. Peep the Source Code on GitHub.

Hosted on Vercel. The source code's got the MIT license.

2025 - 2026 · LibravelUI

Starter Kits

Templates

    Coming Soon

Labs