Badge
FreeA small status pill with neutral, success, and warning tones.
DraftShippedIn reviewLive
npx shadcn@latest add @ui-shrushank/badgeThe install writes a single file to components/ui/Badge.tsx, which exports Badge.
tsx
import { Badge } from "@/components/ui/Badge";tsx
<Badge>Label</Badge>The status pill.
Neutral / success / warning tones, each keyed by more than colour.
Every line below was read out of the file you are about to copy, so you can check each one against the source at the bottom of this page.
- Has an explicit
prefers-reduced-motionbranch: the animation is dropped for an instant state change, and the component stays fully usable without it.
The tone plus its shape/label means a colour-blind user isn't guessing.
1 required, 1 optional.
| Prop | Type | Default |
|---|---|---|
tone | BadgeTone | "neutral" |
childrenrequired | React.ReactNode | none |
toneBadgeTone· default"neutral"childrenrequiredReact.ReactNode
One file, no runtime package. Copy it, or install it with the command at the top of this page.
Badge.tsx
TypeScript