Status bar
FreeA row of period blocks coloured by service status.
pnpm dlx shadcn@latest add https://caliperui.site/r/status-bar.json| Period | Status | Detail |
|---|---|---|
| Day 1 | Operational | |
| Day 2 | Operational | |
| Day 3 | Operational | |
| Day 4 | Operational | |
| Day 5 | Operational | |
| Day 6 | Operational | |
| Day 7 | Operational | |
| Day 8 | Outage | |
| Day 9 | Operational | |
| Day 10 | Operational | |
| Day 11 | Operational | |
| Day 12 | Operational | |
| Day 13 | Operational | |
| Day 14 | Operational | |
| Day 15 | Operational | |
| Day 16 | Operational | |
| Day 17 | Operational | |
| Day 18 | Operational | |
| Day 19 | Degraded | |
| Day 20 | Degraded | |
| Day 21 | Operational | |
| Day 22 | Operational | |
| Day 23 | Operational | |
| Day 24 | Operational | |
| Day 25 | Operational | |
| Day 26 | Operational | |
| Day 27 | Operational | |
| Day 28 | Operational | |
| Day 29 | Operational | |
| Day 30 | Operational |
When to use #
Use it for
- Uptime history on a status page.
- Any timeline of discrete states.
Skip it when
- Continuous values; use a line chart.
Installation #
pnpm dlx shadcn@latest add https://caliperui.site/r/status-bar.json
Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. No account needed. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage #
This is the code behind the preview above. It is built from StatusBar and statusUptime.
import { StatusBar } from "@/components/ui/status-bar" export function UptimeBar() { const status = (index: number) => (index === 7 ? "outage" : index === 18 || index === 19 ? "degraded" : "operational") as "outage" | "degraded" | "operational"; return ( <div className="w-full max-w-xl"> <StatusBar label="API uptime, last 30 days" startLabel="30 days ago" endLabel="Today" data={Array.from({ length: 30 }, (_, index) => ({ id: `d${index}`, label: `Day ${index + 1}`, status: status(index) }))} /> </div> ); }
API reference #
StatusBar
component
statusUptime
component
No props of its own; it accepts the native props of its root element.
Accessibility #
It exposes group and status semantics, with aria-label, aria-busy and aria-hidden kept in step with state. Changes that matter are announced through a live region.
No custom key handling; Tab and the native activation keys do the work.
Motion #
Transitions use the shared duration and easing tokens. Under prefers-reduced-motion those tokens collapse to instant and travel distances go to zero, so state changes still happen without movement.