/
1.1k
Sponsor

Badge

Semantic status indicator badge (success/error/warning/info)

Terminal

Installation

$ pnpm dlx shadcn@latest add @termcn/opentui/badge

Usage

import { Badge } from "@/components/ui/badge";
<Badge variant="success">Active</Badge>

Examples

Basic

A basic default badge.

Terminal

Bold Without Border

Use bold and bordered={false} for an inline label style.

Terminal

Custom Border Style

Customize the border style and padding.

Terminal

API Reference

Badge

PropTypeDefault
childrenstringrequired
variant"default" | "success" | "warning" | "error" | "info" | "secondary""default"
colorstring-
boldbooleanfalse
borderedbooleantrue
borderStyle"single" | "double" | "round" | "bold" | "singleDouble" | "doubleSingle" | "classic""round"
paddingXnumber1