Search

Search the site

All components

Status Badge

Composable status primitive with semantic tones, variants, live/deploy pulses, meta text, and removable/selectable tag behaviour.

Live system status
Online/offline with pulsing dot indicators.
API healthyWorker offlineLive
1import { StatusBadge } from "@/registry/ui";
2
3export function StatusBadgeLiveExample() {
4 return (
5 <div className="flex flex-wrap items-center justify-center gap-2">
6 <StatusBadge status="online" dot>
7 API healthy
8 </StatusBadge>
9 <StatusBadge status="offline" dot variant="outline">
10 Worker offline
11 </StatusBadge>
12 <StatusBadge status="online" size="sm" variant="solid">
13 Live
14 </StatusBadge>
15 </div>
16 );
17}
Loading / deploy
Spinner for loading; deploy with optional pulse dot.
Deploying v2.4.1SyncingRolling update
1import { StatusBadge } from "@/registry/ui";
2
3export function StatusBadgeLoadingExample() {
4 return (
5 <div className="flex flex-wrap items-center justify-center gap-2">
6 <StatusBadge status="deploying" loading>
7 Deploying v2.4.1
8 </StatusBadge>
9 <StatusBadge status="info" loading variant="outline">
10 Syncing
11 </StatusBadge>
12 <StatusBadge status="deploying" dot pulse>
13 Rolling update
14 </StatusBadge>
15 </div>
16 );
17}
With meta
Primary label plus secondary metric or timestamp.
Database12msCache stale2m agoGateway503
1import { StatusBadge } from "@/registry/ui";
2
3export function StatusBadgeMetaExample() {
4 return (
5 <div className="flex flex-col items-center gap-3">
6 <StatusBadge status="success" meta="12ms">
7 Database
8 </StatusBadge>
9 <StatusBadge status="warning" meta="2m ago" variant="outline">
10 Cache stale
11 </StatusBadge>
12 <StatusBadge status="error" meta="503" size="sm">
13 Gateway
14 </StatusBadge>
15 </div>
16 );
17}
Interactive tags
Selectable filters with removable chips.
ProductionEU-WestPaid plan

Click to select · dismiss to remove

1"use client";
2
3import { useState } from "react";
4import { StatusBadge } from "@/registry/ui";
5
6export function StatusBadgeInteractiveExample() {
7 const [tags, setTags] = useState(["Production", "EU-West", "Paid plan"]);
8 const [active, setActive] = useState("Production");
9
10 return (
11 <div className="flex max-w-md flex-col items-center gap-3">
12 <div className="flex flex-wrap justify-center gap-2">
13 {tags.map((tag) => (
14 <StatusBadge
15 key={tag}
16 status={active === tag ? "info" : "neutral"}
17 selectable
18 selected={active === tag}
19 removable
20 variant={active === tag ? "solid" : "soft"}
21 onClick={() => setActive(tag)}
22 onRemove={() => {
23 setTags((current) => {
24 const next = current.filter((t) => t !== tag);
25 setActive((prev) => (prev === tag ? next[0] ?? "" : prev));
26 return next;
27 });
28 }}
29 >
30 {tag}
31 </StatusBadge>
32 ))}
33 </div>
34 <p className="text-center text-xs text-muted-foreground">
35 Click to select · dismiss to remove
36 </p>
37 </div>
38 );
39}

Installation & source

Install via the shadcn CLI or copy the registry files manually.

bash
npx shadcn@latest add @tt-ui/status-badge

Props

NameTypeDefaultDescription
status"neutral" | "success" | "warning" | "error" | "info" | "online" | "offline" | "deploying""neutral"Semantic tone; online/deploying enable pulse defaults
variant"solid" | "soft" | "outline""soft"Visual weight; soft uses subtle gradients
size"sm" | "md""md"Compact or default density
iconReactNodemapped default per statusOverrides default icon; ignored when loading
dotbooleanauto for online/deployingLeading status dot; pulse animates the dot only
pulse / loadingbooleanfalsePulse on dot; loading shows spinner instead of icon
metastringundefinedSecondary text (latency, timestamp, code)
removable / onRemoveboolean / () => voidundefinedDismiss button when both are set
selectable / selectedbooleanfalseSelection ring; use with onClick