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#

StatusBadge props
PropTypeDefault
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#

All alerts, toasts and empty states

Learn more