Molecules · Status tracker
Status tracker
Health over time, drawn as a row of thin bars with one bar per period. The oldest is on the left. Each bar says its status in words and shows them in a tooltip when you hover over it or reach it with the keyboard. The whole row is a single Tab stop, and the arrow keys move along it.
- Best for
- The health history of one service or device, such as uptime over 30 or 90 days.
- Not for
- A current status: use Badge. A measured value: use Sparkline.
This page as Markdown, a plain-text copy for a coding agent (an AI tool that writes code).
Requires
- The root TooltipProvider (AppShell and DemoLayout mount it).
Examples
Thirty days, with a summary
Uptime, last 30 days99.2% up
Code
tsx
const THIRTY: StatusTrackerItem[] = Array.from({ length: 30 }, (_, index) => { const day = new Date(Date.UTC(2026, 8, 16 + index)) const date = day.toLocaleDateString('en-GB', { day: 'numeric', month: 'short', timeZone: 'UTC' }) if (index === 8) return { id: `d${index}`, status: 'warning', label: `${date}: 2 alerts, 14 min degraded` } if (index === 19) return { id: `d${index}`, status: 'hostile', label: `${date}: 41 min down` } if (index === 23) return { id: `d${index}`, status: 'warning', label: `${date}: 1 alert, 6 min degraded` } if (index === 26) return { id: `d${index}`, status: 'neutral', label: `${date}: no readings` } return { id: `d${index}`, status: 'ok', label: `${date}: no alerts` }})<div className="w-full max-w-xl"> <StatusTracker label="Uptime, last 30 days" summary="99.2% up" items={THIRTY} /></div>Ninety days in the same width
Uptime, last 90 days99.6% up
Code
tsx
const NINETY: StatusTrackerItem[] = Array.from({ length: 90 }, (_, index) => ({ id: `n${index}`, status: index % 37 === 12 ? 'hostile' : index % 23 === 5 ? 'warning' : 'ok', label: `Day ${index + 1} of 90`,}))<div className="w-full max-w-xl"> <StatusTracker label="Uptime, last 90 days" summary="99.6% up" items={NINETY} /></div>Other status words
Door sensor, last 8 hours
Code
tsx
<div className="w-full max-w-xs"> <StatusTracker label="Door sensor, last 8 hours" statusLabels={{ ok: 'Closed', warning: 'Left open', hostile: 'Forced', neutral: 'Offline' }} items={[ { id: 'h1', status: 'ok', label: '02:00 to 03:00' }, { id: 'h2', status: 'ok', label: '03:00 to 04:00' }, { id: 'h3', status: 'warning', label: '04:00 to 05:00, open 9 min' }, { id: 'h4', status: 'ok', label: '05:00 to 06:00' }, { id: 'h5', status: 'neutral', label: '06:00 to 07:00' }, { id: 'h6', status: 'ok', label: '07:00 to 08:00' }, { id: 'h7', status: 'ok', label: '08:00 to 09:00' }, { id: 'h8', status: 'ok', label: '09:00 to 10:00' }, ]} /></div>Anatomy
| Part | What it is |
|---|---|
| Label row | The label in a monospaced font on the left, and the optional summary on the right. |
| List | A ul (bulleted list element) named by the label, with one li (list item) per bar, so a screen reader hears how many bars there are and where each one sits. |
| Bar | A block 32px (pixels) tall in the status colour. It has role="img" and aria-roledescription="status bar", which tell screen readers what it is, and its name is the status word plus the label. |
| Tooltip | The same text as the name, shown on hover and on keyboard focus. |
Props
- labelstring
- Required. Names the row, for example "Uptime, last 30 days".
- itemsreadonly StatusTrackerItem[]
- Required. Oldest first.
- summaryReactNode
- Shown on the right of the label row, for example "99.2% up".
- statusLabelsPartial<Record<StatusTrackerStatus, string>>
- Replaces the status words: Operational, Degraded, Down, No data.
- classNamestring
- Added to the root.
- refRef<HTMLDivElement>
- Passed through to the root.
- id (StatusTrackerItem)string
- Required. A key that never changes for that item.
- status (StatusTrackerItem)'ok' | 'warning' | 'hostile' | 'neutral'
- Required. ok means up. warning means degraded. hostile means down or failed. neutral means no data.
- label (StatusTrackerItem)string
- Required. The period and what happened, for example "12 Oct: 2 alerts, 14 min degraded".
- statusTrackerText()(item, words?) => string
- Builds the text a bar uses for its name and tooltip, for example "Degraded. 12 Oct: 2 alerts".
Keyboard
| Keys | Result |
|---|---|
| Tab | Moves into the row, landing on the last bar that had focus (the newest one the first time), and moves out again. |
| ArrowLeftArrowRight | Moves one bar older or newer and shows its tooltip. |
| HomeEnd | Jumps to the oldest or the newest bar. |
| Escape | Hides the tooltip. Focus stays on the bar. |
Do and don't
Do
- Write each item label with its period and what happened, not just the status. The status word is added for you.
- Put the headline figure in summary, so the row has a number people can read before they explore it.
- Use neutral for periods with no data, so a gap looks like a gap and not like a healthy day.
Don't
- Don't start an item label with the status word as well. It's already said first.
- Don't use it for more than about 90 bars. At a 320px-wide screen the bars get thinner than 2px.
- Don't make a bar do anything when clicked. It's a reading, not a control.