# Tracker

A row of status blocks, one per day or check, for uptime or completion.

- Family: charts
- Import: `import { Tracker } from "@senvenli/react/charts";`
- Page: https://design.senvenli.com/docs/components/tracker
- JSON: https://design.senvenli.com/docs/components/tracker.json

## Example: Uptime

One block per day; the legend and the summary name every color.

```tsx
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" },
      }}
    />
  );
}
```

## Examples

### With notes and a summary

A block's tooltip says what happened; your own sentence states the result.

```tsx
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

- [calendar-heatmap](https://design.senvenli.com/docs/components/calendar-heatmap.md): Each day has an amount, not a status.
- [progress](https://design.senvenli.com/docs/components/progress.md): Only the overall share done matters.

## 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 | Required | Description |
| --- | --- | --- | --- | --- |
| title | `string` |  | no | What the chart shows, over it; leave it out when a card or a heading already says so. |
| aria-label | `string` |  | no | Names the chart when it has no visible `title` (a card's heading already says what it shows). |
| period | `string` |  | no |  |
| isLoading | `boolean` |  | no |  |
| emptyState | `React.ReactNode` |  | no | Shown instead of the plot when there is no data: an `EmptyState size="small"` or text; "No data" by default. |
| data | `readonly TrackerDatum[]` |  | yes |  |
| statusMap | `Readonly<Record<string, { tone: TrackerTone; label: string; }>>` |  | yes | Each status's tone and the word for it ("Operational", "Outage"); the legend follows this order. |
| summary | `string` |  | no | The result in a sentence ("26 days operational, 1 outage"); the counts per status by default. |

### Tokens it reads

`--ds-background-brand-subtle`, `--ds-background-neutral`, `--ds-background-neutral-pressed`, `--ds-background-selected-hovered`, `--ds-background-selected-pressed`, `--ds-border`, `--ds-border-bold`, `--ds-border-focused`, `--ds-chart-1`, `--ds-chart-2`, `--ds-chart-3`, `--ds-chart-4`, `--ds-chart-5`, `--ds-chart-neutral`, `--ds-icon-danger`, `--ds-icon-success`, `--ds-icon-warning`, `--ds-link`, `--ds-radius-medium`, `--ds-radius-small`, `--ds-radius-xsmall`, `--ds-shadow-overlay`, `--ds-space-050`, `--ds-space-075`, `--ds-space-100`, `--ds-space-150`, `--ds-space-200`, `--ds-space-300`, `--ds-space-400`, `--ds-surface-overlay`, `--ds-surface-raised`, `--ds-text`, `--ds-text-danger`, `--ds-text-subtle`, `--ds-text-subtlest`, `--ds-text-success`

## Related

- [calendar-heatmap](https://design.senvenli.com/docs/components/calendar-heatmap.md)
