caliper uidocs

Status bar

Free

A row of period blocks coloured by service status.

Installs components/ui/status-bar.tsxDepends on d3-shapeMotion shared motion tokens
pnpm dlx shadcn@latest add https://caliperui.site/r/status-bar.json
API uptime, last 30 days96.67% uptime

API uptime, last 30 days
PeriodStatusDetail
Day 1Operational
Day 2Operational
Day 3Operational
Day 4Operational
Day 5Operational
Day 6Operational
Day 7Operational
Day 8Outage
Day 9Operational
Day 10Operational
Day 11Operational
Day 12Operational
Day 13Operational
Day 14Operational
Day 15Operational
Day 16Operational
Day 17Operational
Day 18Operational
Day 19Degraded
Day 20Degraded
Day 21Operational
Day 22Operational
Day 23Operational
Day 24Operational
Day 25Operational
Day 26Operational
Day 27Operational
Day 28Operational
Day 29Operational
Day 30Operational

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 #

terminal
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.

example.tsx
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
PropTypeDefault
label *string—
data *readonly StatusPeriod[]—
startLabelstring—
endLabelstring—
loadingboolean—
errorstring—
classNamestring—

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.