$ Badge
static output5 presets
Colored inline labels and tags for terminal output. Includes preset styles, outline badges, dot indicators, and fully custom colors.
# Preview
badge demo
Preset badges:
PASS FAIL WARN INFO N/A
Outline badges:
[typescript] [node.js] [v1.0.0] [MIT]
Status indicators:
● Production ● Staging ● Development ● Offline
Custom badges:
DEPLOY RELEASE HOTFIX
# Usage
example.ts
import { Badge, badge, fg, bg } from "@vr_patel/tui";
// Preset badges
console.log(Badge.success("PASS"));
console.log(Badge.error("FAIL"));
console.log(Badge.warning("WARN"));
console.log(Badge.info("INFO"));
console.log(Badge.neutral("N/A"));
// Outline style
console.log(Badge.outline("v2.1.0", fg.blue));
console.log(Badge.outline("typescript", fg.cyan));
// Status dot indicator
console.log(Badge.status("Online", fg.green));
console.log(Badge.status("Offline", fg.red));
// Custom colors
console.log(Badge.custom("DEPLOY", fg.black, bg.brightMagenta));# API
| Prop | Type | Default | Description |
|---|---|---|---|
| text | string | required | Badge label text |
| preset | BadgePreset | required | success | error | warning | info | neutral |
| bold | boolean | true | Bold text style |
| rounded | boolean | true | Add padding for pill-like appearance |