import { CalendarDate } from "@internationalized/date";
import { Tracker } from "@senvenli/react/charts";
// Thirty fixed days ending March 18, 2026: the same strip whenever the page is read.
const START = new CalendarDate(2026, 2, 17);
const STATUS: Record<number, string> = { 11: "outage", 12: "degraded", 22: "degraded" };
const DAYS = Array.from({ length: 30 }, (_, index) => ({ date: START.add({ days: index }), status: STATUS[index] ?? "operational" }));
export default function Example() {
return (
<Tracker
title="Checkout API"
period="Last 30 days"
data={DAYS}
statusMap={{
operational: { tone: "success", label: "Operational" },
degraded: { tone: "warning", label: "Degraded" },
outage: { tone: "danger", label: "Outage" },
}}
/>
);
}import { Tracker } from "@senvenli/react/charts";Examples
With notes and a summary
A block's tooltip says what happened; your own sentence states the result.import { Tracker } from "@senvenli/react/charts";
// Dates as ISO strings work as well as CalendarDate values.
const RUNS = [
{ date: "2026-03-09", status: "passed" },
{ date: "2026-03-10", status: "passed" },
{ date: "2026-03-11", status: "failed", tooltip: "Export timed out after 30 minutes" },
{ date: "2026-03-12", status: "passed" },
{ date: "2026-03-13", status: "passed" },
{ date: "2026-03-14", status: "skipped", tooltip: "Paused for maintenance" },
{ date: "2026-03-15", status: "skipped", tooltip: "Paused for maintenance" },
{ date: "2026-03-16", status: "passed" },
{ date: "2026-03-17", status: "passed" },
{ date: "2026-03-18", status: "passed" },
];
export default function Example() {
return (
<Tracker
title="Nightly order export"
period="March 9–18, 2026"
data={RUNS}
summary="7 of 10 exports completed"
statusMap={{
passed: { tone: "success", label: "Completed" },
failed: { tone: "danger", label: "Failed" },
skipped: { tone: "neutral", label: "Skipped" },
}}
/>
);
}Guidelines
When to use it
- Status over a run of days or checks.
Use something else when
- Each day has an amount, not a status. Calendar heatmap
- Only the overall share done matters. Progress
Accessibility
Built in
- A "Show as table" button shows the same data as a table, which screen readers get by default.
You provide
- A title that says what the figure is.
API reference
Tracker
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | – | What the chart shows, over it; leave it out when a card or a heading already says so. |
aria-label | string | – | Names the chart when it has no visible |
period | string | – | |
isLoading | boolean | – | |
emptyState | React.ReactNode | – | Shown instead of the plot when there is no data: an |
dataRequired | readonly TrackerDatum[] | – | |
statusMapRequired | Readonly<Record<string, { tone: TrackerTone; label: string; }>> | – | Each status's tone and the word for it ("Operational", "Outage"); the legend follows this order. |
summary | string | – | The result in a sentence ("26 days operational, 1 outage"); the counts per status by default. |
titlestringWhat the chart shows, over it; leave it out when a card or a heading already says so.
aria-labelstringNames the chart when it has no visible
title(a card's heading already says what it shows).periodstringisLoadingbooleanemptyStateReact.ReactNodeShown instead of the plot when there is no data: an
EmptyState size="small"or text; "No data" by default.dataRequiredreadonly TrackerDatum[]statusMapRequiredReadonly<Record<string, { tone: TrackerTone; label: string; }>>Each status's tone and the word for it ("Operational", "Outage"); the legend follows this order.
summarystringThe result in a sentence ("26 days operational, 1 outage"); the counts per status by default.