How it works
A flex row of equal blocks that share the available width, so 30 or 90 periods fit any card without scrolling; the gap scales with the width and stays between 1 and 3px. On mount the blocks grow up from the baseline in a quick left-to-right wave. Pointing at a block stretches it a little on a spring, dims every other block to 40% and opens a dark tip with the date, a colour swatch and status name, and an optional note. The tip aligns to the start, centre or end of the bar depending on where the block sits, so it never leaves the card.
Use it for
- A status page or a health card: daily uptime of a few services.
- Any streak of discrete outcomes: builds, check-ins, deliveries per day.
Look elsewhere when
- Continuous values such as latency: use a line or bar chart.
Usage
import { TrackerBar } from './TrackerBar.jsx'
export function ApiUptime({ days }) {
return (
<TrackerBar
title="Public API"
value="99.95% uptime"
label="Public API, daily status"
data={days.map((d) => ({ key: d.date, status: d.status, label: d.dateLabel, note: d.incident }))}
startLabel="90 days ago"
endLabel="Today"
legend
/>
)
}Props
| Prop | Type | Default | What it does |
|---|---|---|---|
data | { key?, status: string, label: string, note?: string }[] | — | One entry per period, oldest first. status picks a colour and name from statuses; label (the date) and note appear in the tip. |
statuses | Record<string, { label: string, color: string }> | up / degraded / down / none | Merged over the defaults: success, warning, danger and the chart track colour. |
title / value | ReactNode | — | Name on the left and a figure such as uptime on the right, above the bar. |
startLabel / endLabel | ReactNode | — | Ends of a thin axis under the bar. |
legend / legendLabel | boolean / string | false | A legend of the statuses that occur in data. |
rounded | boolean | true | Pill-shaped blocks; false gives crisp 1.5px corners. |
label | string | 'Status history' | Accessible name of the group of blocks. |
Accessibility
- The row is a group with a name; each block is an image named with its date, status and note, so the colour is never the only signal.
- One block is in the Tab order (the latest); arrow keys move between blocks, Home and End jump to the ends, and Escape hides the tip.
- The tip is decorative: what it shows is already each block's accessible name.
- Reduced motion removes the wave and the stretch; dimming stays as an instant change.
Motion
Entrance: 520ms grow per block on the reveal curve, spread over 420ms across the row. Focus: 260ms spring stretch, 160ms dimming, 200ms tip rise.
Add it to your project
Copy the prompt into Codex or Claude Code. The agent reads the published source, shows you what it will write and adds the component next to your own.
TrackerBar.jsxtracker-bar.csstokens.cssREADME.md
Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.



