Black Friday is here 🔥 Get Wensity Pro for 20% less with

Badge

React badges for statuses, plans, and tags in eight tones, with presence dots that can pulse, icon slots, and removable chips with a labeled close button.

Loading preview

Examples

Practical examples and common states for the same installable component.

Status Stack

Subtle color, shape, and shadow changes for readable state.

examples/badge-status.tsx
import {
IconCheck,
IconClock,
IconShieldCheck,
IconX,
} from "@tabler/icons-react";
import { Badge } from "@/components/wensity/badge";
export function StatusBadges() {
return (
<div className="flex flex-wrap gap-2">
<Badge variant="success" leftIcon={<IconCheck />} interactive>
Synced
</Badge>
<Badge variant="warning" leftIcon={<IconClock />} interactive>
Queued
</Badge>
<Badge variant="info" leftIcon={<IconShieldCheck />} interactive>
Protected
</Badge>
<Badge variant="danger" leftIcon={<IconX />} interactive>
Blocked
</Badge>
</div>
);
}

Filter Chips

Removable badges for search, filters, and saved views.

Requires: button

examples/badge-filter-chips.tsx
"use client";
import * as React from "react";
import { IconFilter } from "@tabler/icons-react";
import { Badge } from "@/components/wensity/badge";
import { Button } from "@/components/wensity/button";
export function FilterChips() {
const [chips, setChips] = React.useState(["Free", "React", "Animated"]);
return (
<div className="flex flex-wrap gap-2">
<Badge variant="outline" leftIcon={<IconFilter />}>
Components
</Badge>
{chips.map((chip) => (
<Badge
key={chip}
variant={chip === "Animated" ? "brand" : "neutral"}
onRemove={() =>
setChips((current) => current.filter((item) => item !== chip))
}
removeLabel={`Remove ${chip}`}
>
{chip}
</Badge>
))}
{chips.length === 0 ? (
<Button
size="sm"
variant="secondary"
onClick={() => setChips(["Free", "React", "Animated"])}
>
Reset filters
</Button>
) : null}
</div>
);
}

Plan Labels

Small commercial labels with enough polish for pricing and account UI.

examples/badge-plan.tsx
import { IconLock, IconStar } from "@tabler/icons-react";
import { Badge } from "@/components/wensity/badge";
export function PlanBadges() {
return (
<div className="flex flex-wrap gap-2">
<Badge variant="neutral" size="sm">
Starter
</Badge>
<Badge variant="brand" size="sm" leftIcon={<IconStar />}>
Pro
</Badge>
<Badge variant="carbon" size="sm" leftIcon={<IconLock />}>
Team
</Badge>
</div>
);
}

Live States

Dot badges for uptime, queues, streaming, and async work.

examples/badge-live.tsx
import { Badge } from "@/components/wensity/badge";
export function LiveBadges() {
return (
<div className="flex flex-wrap gap-2">
<Badge variant="success" dot pulseDot>
Online
</Badge>
<Badge variant="warning" dot>
Delayed
</Badge>
<Badge variant="danger" dot>
Paused
</Badge>
</div>
);
}

Icon Badges

Icon slots preserve rhythm without turning badges into buttons.

examples/badge-icons.tsx
import {
IconArrowUpRight,
IconBolt,
IconDatabase,
IconPlayerPlay,
IconSparkles,
} from "@tabler/icons-react";
import { Badge } from "@/components/wensity/badge";
export function IconBadges() {
return (
<div className="flex flex-wrap gap-2">
<Badge variant="brand" leftIcon={<IconSparkles />} interactive>
Fresh
</Badge>
<Badge variant="info" leftIcon={<IconDatabase />} interactive>
Synced
</Badge>
<Badge variant="warning" leftIcon={<IconBolt />} interactive>
Usage high
</Badge>
<Badge
variant="carbon"
leftIcon={<IconPlayerPlay />}
rightIcon={<IconArrowUpRight />}
interactive
>
Launch
</Badge>
</div>
);
}

Sizes

Three sizes that keep text, icons, and dots aligned.

examples/badge-sizes.tsx
import { IconFlame, IconShieldCheck } from "@tabler/icons-react";
import { Badge } from "@/components/wensity/badge";
export function BadgeSizes() {
return (
<div className="flex flex-wrap items-center gap-2">
<Badge size="sm" variant="success" dot>
Small
</Badge>
<Badge size="md" variant="brand" leftIcon={<IconFlame />}>
Default
</Badge>
<Badge size="lg" variant="carbon" leftIcon={<IconShieldCheck />}>
Large
</Badge>
</div>
);
}

Shapes

Different radius options for compact, app, and pill contexts.

examples/badge-shapes.tsx
import { Badge } from "@/components/wensity/badge";
export function BadgeShapes() {
return (
<div className="flex flex-wrap items-center gap-2">
<Badge radius="sm" variant="outline">
Square
</Badge>
<Badge radius="md" variant="info">
Rounded
</Badge>
<Badge radius="pill" variant="success" dot>
Pill
</Badge>
</div>
);
}

Overview

Badge is a React and Tailwind CSS badge component, in Next.js or any React app, for statuses, plans, counts, and tags. Eight tones run from neutral, success, warning, danger, and info to brand, carbon, and outline, in three sizes with pill or squared corners. dot adds a colored presence dot that can pulse, icon slots sit on either side of the text, and onRemove turns it into a removable chip whose labeled X button keeps the click from reaching the badge. With asChild the styles move onto your own link or button. Long labels truncate in tight rows.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add badge

Usage

Import Badge from @/components/wensity/badge and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import { Badge } from "@/components/wensity/badge";
export function BadgeDemo() {
return (
<Badge variant="success" dot>
Active
</Badge>
);
}

Props

PropTypeDefaultDescription
variant"neutral" | "success" | "warning" | "danger" | "info" | "brand" | "carbon" | "outline""neutral"Status colour recipe, drawn from the shared status tokens.
size"sm" | "md" | "lg""md"Height, padding, and text size.
radius"sm" | "md" | "pill""pill"Corner rounding. pill is fully round.
interactivebooleanfalseAdds hover and focus affordances for badges that act as filters or buttons.
dotbooleanfalseRenders a leading status dot in the variant colour.
pulseDotbooleanfalseAnimates the status dot to signal a live or ongoing state.
leftIconReact.ReactNode-Icon before the label.
rightIconReact.ReactNode-Icon after the label.
onRemove() => void-When set, renders a remove button. Use for token or filter chips.
removeLabelstring"Remove"Accessible label for the remove button.
asChildbooleanfalseRenders the child element instead of a span, keeping styles.
  • Multi-Select Tag Input component preview

    Multi-Select Tag Input

    A tag input where pills pop in as you add them and slide out on remove, closing the gap without snapping the layout.

  • Glowing Border component preview

    Glowing Border

    Glowing border CSS for cards: a cursor glowing effect, or beams, spins and pulses.

  • Text Shimmer component preview

    Text Shimmer

    A CSS shimmer sweep for headlines, one single element and entirely GPU-friendly.

  • Hover Image Gallery component preview

    Hover Image Gallery

    Hover a card in the fanned artwork row and it rises to the front, showing a colored pill with that card's title.