Badge

Highlight important information, like a new feature or a notification.

Badge

Badge

Dan Spratling

Badge

Usage

import { Badge } from "#/ui/components/Badge"
<Badge>Badge</Badge>

Variants

Each badge has 3 different variants to choose between

Pill

Rounded

Square

Size

Each badge has 3 different size options to choose between

sm

md

lg

Color

Random

By default, badges will randomly select a color from the color options

Badge

Palette

You can specify any color from the tailwind color palette

Gray
Red
Orange
Amber
Yellow
Lime
Green
Emerald
Teal
Cyan
Sky
Blue
Indigo
Violet
Purple
Fuchsia
Pink
Rose

Context

You can also specify a color based on its context

Info
Success
Warning
Danger

Transparent

You can pass the transparent prop to remove the badge background color, while leaving the highlight colors

Info

Success

Warning

Danger

Dot

You can pass the dot prop to add a dot to your badge

Info

Success

Warning

Danger

Image

You can pass an image object to add an image to your badge (this will disable the dot)

Dan Spratling

Info

Dan Spratling

Success

Dan Spratling

Warning

Dan Spratling

Danger

Icons

You can pass an icon as a child to add an icon to your badge

Info

Info

Warning

Danger

Interactivity

By default, badges are not interactive but you can pass a prop with interactivity if you need it (don’t forget to style it)

Remove

Customization

Classes

You can customize badges further by passing a className prop, which will override any styles already set.

Destructive