Utility
AI
Terminal
badge-demo
No opentui live preview is registered for this example yet.
Installation
pnpm dlx shadcn@latest add @termcn/badge
Usage
import { Badge } from "@/components/ui/badge";<Badge variant="success">Active</Badge>Examples
Basic
A basic default badge.
Terminal
badge-basic
No opentui live preview is registered for this example yet.
Bold Without Border
Use bold and bordered={false} for an inline label style.
Terminal
badge-bold
No opentui live preview is registered for this example yet.
Custom Border Style
Customize the border style and padding.
Terminal
badge-custom-border
No opentui live preview is registered for this example yet.
API Reference
Badge
| Prop | Type | Default |
|---|---|---|
children | string | required |
variant | "default" | "success" | "warning" | "error" | "info" | "secondary" | "default" |
color | string | undefined |
bold | boolean | false |
bordered | boolean | true |
borderStyle | "single" | "double" | "round" | "bold" | "singleDouble" | "doubleSingle" | "classic" | "round" |
paddingX | number | 1 |