Badge

Badge

Inline status labels and category tags with muted tinted variants

Default
Secondary
Outline
Destructive
Success
Warning
Info

Installation

npx @ravikumarsurya/mdx-ui add badge

Usage

page.mdx
import { Badge } from "@/components/mdx/badge"
 
<Badge>Default</Badge>
<Badge variant="success">Published</Badge>
<Badge variant="warning">Beta</Badge>
<Badge variant="info">New</Badge>

Examples

In content

Use badges inline to label status, categories, or version numbers.

page.mdx
This feature is <Badge variant="info">Beta</Badge> and subject to change.
 
Release <Badge variant="success">v1.0.0</Badge> is now stable.
 
This API is <Badge variant="destructive">Deprecated</Badge>.

Version tags

page.mdx
## API Reference <Badge variant="outline">v2</Badge>
 
### createUser() <Badge variant="success">Stable</Badge>
 
### legacyAuth() <Badge variant="warning">Deprecated</Badge>

All variants

VariantUse for
defaultGeneral labels, primary categorisation
secondarySecondary or neutral labels
outlineSubtle, low-emphasis tags
successStable, published, passing
warningBeta, deprecated, needs attention
infoNew, preview, informational
destructiveRemoved, broken, critical

Props

PropTypeDefaultDescription
variant"default" | "secondary" | "outline" | "destructive" | "success" | "warning" | "info""default"Visual style of the badge
classNamestringAdditional CSS classes
childrenReact.ReactNodeBadge label content