Skip to Content
Nextra 4.0 is released 🎉

Badge

The Badge component is a pixel-art styled label indicator.
It supports multiple variants, sizes, and dismissible behavior — perfect for status indicators, tags, and notifications with a retro aesthetic.


🚀 Usage

Basic Example


Primary
import { Badge } from "pixelartui-react"; <Badge text="Primary" variant="primary" />

Variants


Primary
Success
Error
Warning
Info
<Badge text="Primary" variant="primary" /> <Badge text="Success" variant="success" /> <Badge text="Error" variant="error" /> <Badge text="Warning" variant="warning" /> <Badge text="Info" variant="info" />

Sizes


Small
Medium
Large
<Badge text="Small" size="small" /> <Badge text="Medium" size="medium" /> <Badge text="Large" size="large" />

Dismissible


Dismiss me
<Badge text="Dismiss me" variant="info" dismissible onDismiss={() => console.log("dismissed")} />

Styles


Dark style
Light style
<Badge text="Dark style" badgeStyle="dark" /> <Badge text="Light style" badgeStyle="light" />

🔧 Props

PropTypeDefaultDescription
textstringThe badge text content.
size"small" | "medium" | "large""medium"Size of the badge.
variant"primary" | "success" | "error" | "warning" | "info""primary"The visual variant of the badge.
badgeStyle"dark" | "light""dark"Applies a light or dark theme to the component.
dismissiblebooleanfalseShows a dismiss button when true.
onDismiss() => voidundefinedCallback fired when the dismiss button is clicked.
classNamestringundefinedAdds additional CSS classes for custom styling.
Last updated on