Status Badge
Tailwind status badge with a tinted fill, hairline border and colored dot in neutral, success, warning, danger, accent and info tones that read as one set.
src/registry/ui/status-badge.tsx/r/status-badge.json
LiveDegradedDownPremium
Tones
Installation#
bash
npx shadcn@latest add @minidev/status-badge
MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/status-badge.json
Usage#
tsx
import { StatusBadge } from "@/components/ui/status-badge"
export function Example() {
return (
<StatusBadge tone={r.status === "active" ? "success" : r.status === "past_due" ? "danger" : "warning"}>{r.status}</StatusBadge>
)
}
API reference#
| Prop | Type | Default |
|---|---|---|
tone | "neutral" | "success" | "warning" | "danger" | "accent" | "info" | "neutral" |
Also accepts every prop of <span>, passed through to the root element.
Dependencies#
npm
class-variance-authority
Built from
No other MiniDev files
Examples#
Related feedback components#
BadgeShadcn style badge in seven variants: default, accent, secondary, destructive, outline, ghost and link. Renders as a span or any element, with icon support.BannerInline notice banner in accent, warning or danger tones, with a status role, a slot for an action button and an optional dismiss icon on the right.CalloutTailwind callout box in info, success, warning or danger tones with an optional bold title. Uses the note role, which suits docs, forms and setup steps.Empty SearchNo results state for search that echoes the query in the title and suggests trying another query or clearing filters. Built on the empty state component.Empty StateDashed empty state panel with an icon slot, title, description and an optional call to action button. Use it for first run screens and empty lists in React.Error StateReact error state panel with an alert role, a title, explanation and an optional Try again button that calls your retry handler. For failed fetches.
All alerts, toasts and empty states