Skip to main content
Version: 1.0.3

Badge

Badges are small, theme-aware status descriptors for dashboards, CMS-style tools, and any UI that needs to label state (Draft/Published, CREATE/UPDATE/DELETE, Active/Disabled, role tags, severity labels) alongside a dedicated notification-counter variant for floating counts on icons and buttons.

StatusFeaturedDismissible
Notifications3

Installation

ignix add component badge

Usage

Import the component:

import { Badge } from '@ignix-ui/badge';

Status Pill

<Badge variant="success">Published</Badge>
<Badge variant="secondary">Draft</Badge>
<Badge variant="destructive">Archived</Badge>

With an Icon

<Badge variant="info" icon={<Star className="h-3 w-3" />}>
Featured
</Badge>

Dismissible

import { useState } from 'react';

function DismissibleTag() {
const [visible, setVisible] = useState(true);
if (!visible) return null;

return (
<Badge variant="secondary" onRemove={() => setVisible(false)}>
React
</Badge>
);
}

Notification Counter (Attached)

<Badge variant="notification" anchor={<Mail className="h-10 w-10" />}>
3
</Badge>

Props

PropTypeDefaultDescription
childrenReact.ReactNodeundefinedContent displayed inside the badge
variant"default" | "secondary" | "success" | "warning" | "destructive" | "info" | "purple" | "outline" | "notification""default"Color/style of the badge; "notification" reproduces the original circular counter look
size"sm" | "md" | "lg""md"Size of the badge
iconReact.ReactNodeundefinedLeading icon, rendered before the content
onRemove() => voidundefinedRenders a dismiss button after the content; called when it's clicked
removeLabelstring"Remove"Accessible label for the dismiss button
anchorReact.ReactNodeundefinedAnchors the badge to the top-right corner of this element instead of rendering inline
animate"none" | "pulse" | "bounce" | "tinypop""tinypop" for notification, "none" otherwiseMotion applied to the badge
classNamestringundefinedAdditional CSS classes for the badge