# Tracker

> A row of status blocks for uptime, job runs, and any history of discrete states.

Source: https://www.honestui.com/docs/charts/tracker/static

### Basic Tracker

```tsx
"use client";

import { Tracker, type ChartConfig } from "honestui/charts";

// Scenario: 90 days of API uptime
const incidents: Record<number, { status: string; uptime: number; note: string }> = {
  17: { status: "degraded", uptime: 99.2, note: "Elevated latency in us-east" },
  18: { status: "degraded", uptime: 99.6, note: "Elevated latency in us-east" },
  41: { status: "outage", uptime: 97.1, note: "Database failover, 42 min" },
  63: { status: "degraded", uptime: 99.5, note: "Webhook delivery delays" },
  82: { status: "maintenance", uptime: 99.9, note: "Scheduled maintenance" },
};

const start = Date.UTC(2026, 7, 28);
const data = Array.from({ length: 90 }, (_, index) => {
  const date = new Date(start + index * 86_400_000).toLocaleDateString("en-US", {
    month: "short",
    day: "numeric",
    timeZone: "UTC",
  });
  const incident = incidents[index];
  return {
    date,
    status: incident?.status ?? "operational",
    uptime: incident?.uptime ?? 100,
    note: incident?.note ?? "",
  };
});

const chartConfig = {
  operational: { label: "Operational", colors: { light: ["#10b981"], dark: ["#10b981"] } },
  degraded: { label: "Degraded", colors: { light: ["#f59e0b"], dark: ["#f59e0b"] } },
  outage: { label: "Outage", colors: { light: ["#ef4444"], dark: ["#ef4444"] } },
  maintenance: { label: "Maintenance", colors: { light: ["#3b82f6"], dark: ["#3b82f6"] } },
} satisfies ChartConfig;

const average = data.reduce((sum, day) => sum + day.uptime, 0) / data.length;

export function ExampleTracker() {
  return (
    <div className="grid w-full max-w-xl gap-3 text-xs">
      <div className="flex items-baseline justify-between">
        <span className="text-foreground font-medium">API · last 90 days</span>
        <span className="text-muted-foreground">
          <span className="text-foreground font-mono tabular-nums">{average.toFixed(2)}%</span> uptime
        </span>
      </div>
      <Tracker
        data={data}
        config={chartConfig}
        statusKey="status"
        labelKey="date"
        valueKey="uptime"
        valueFormatter={(value) => `${value.toFixed(1)}%`}
        detailFormatter={(day) => day.note || undefined}
        showLegend
      />
    </div>
  );
}

```

## Overview [#overview]

A tracker draws one block per period and colors it by status, the pattern behind status pages and uptime monitors. Use it when each period has one categorical state, such as operational, degraded, or down, and readers need to spot when problems happened. When the measure is continuous, such as latency or error rate, use a [Line Chart](/docs/charts/line-chart/static) or a [Sparkline](/docs/charts/sparkline/static) instead.

## Anatomy [#anatomy]

`Tracker` reads a status and a label from each row. The status names a `config` entry, which supplies that status's color and label; a missing or unknown status renders as a neutral "no data" block. Blocks share the width evenly, separated by `gap`. The optional tooltip shows the label, the status, an optional `valueKey` value, and a `detailFormatter` note. `showLegend` lists the statuses from `config` under the blocks.

## Accessibility [#accessibility]

Color is not the only signal. Every block is a list item with an accessible name such as "Oct 8: Outage, 97.1%", and the list's generated name counts each status, for example "90 periods: 85 Operational, 3 Degraded, 1 Outage, 1 Maintenance". The blocks form one tab stop: arrow keys, Home, and End move between them, and focus shows the same tooltip as hover. With `onBlockClick`, Enter and Space activate the focused block. Write the headline figure, such as the uptime percentage, in real text near the tracker.

## Installation [#installation]

<CommandBlock commands="[&#x22;honestui&#x22;]" />

## Usage [#usage]

```tsx
import { Tracker, type ChartConfig } from "honestui/charts";
```

```tsx
const chartConfig = {
  operational: { label: "Operational", colors: { light: ["#10b981"] } },
  degraded: { label: "Degraded", colors: { light: ["#f59e0b"] } },
  outage: { label: "Outage", colors: { light: ["#ef4444"] } },
} satisfies ChartConfig;

<Tracker
  data={days}
  config={chartConfig}
  statusKey="status"
  labelKey="date"
  valueKey="uptime"
  valueFormatter={(value) => `${value}%`}
  showLegend
/>
```

Unlike the canvas charts, the tracker is drawn with DOM elements, so each block can take focus and hundreds of periods stay crisp at any width.

## Examples [#examples]

### One row per service [#one-row-per-service]

### Status page

```tsx
"use client";

import { Tracker, type ChartConfig } from "honestui/charts";

// Scenario: A status page with one row per service, the last 30 days
const chartConfig = {
  operational: { label: "Operational", colors: { light: ["#10b981"], dark: ["#10b981"] } },
  degraded: { label: "Degraded", colors: { light: ["#f59e0b"], dark: ["#f59e0b"] } },
  outage: { label: "Outage", colors: { light: ["#ef4444"], dark: ["#ef4444"] } },
} satisfies ChartConfig;

function history(issues: Record<number, "degraded" | "outage">, missingBefore = 0) {
  return Array.from({ length: 30 }, (_, index) => ({
    day: `Day ${index + 1}`,
    // Days before a service launched have no status and render as no data.
    status: index < missingBefore ? null : (issues[index] ?? "operational"),
  }));
}

const services = [
  { name: "Dashboard", data: history({ 12: "degraded" }) },
  { name: "API", data: history({ 4: "degraded", 21: "outage", 22: "degraded" }) },
  { name: "Webhooks", data: history({}) },
  { name: "Edge storage", data: history({ 27: "degraded" }, 9) },
];

export function ExampleTrackerServices() {
  return (
    <div className="grid w-full max-w-xl gap-4 text-xs">
      {services.map((service) => (
        <div key={service.name} className="grid grid-cols-[6.5rem_1fr] items-center gap-4">
          <span className="text-foreground truncate font-medium">{service.name}</span>
          <Tracker
            data={service.data}
            config={chartConfig}
            statusKey="status"
            labelKey="day"
            height={24}
            gap={3}
            emptyLabel="Not launched"
            ariaLabel={`${service.name} status, last 30 days`}
          />
        </div>
      ))}
    </div>
  );
}

```

Several trackers share one `config`, so a status page reads as a single grid. Periods before a service launched have a `null` status and show the `emptyLabel`.

### Loading State [#loading-state]

### isLoading='true'

```tsx
"use client";

import { Tracker, type ChartConfig } from "honestui/charts";

const chartConfig = {
  operational: { label: "Operational", colors: { light: ["#10b981"], dark: ["#10b981"] } },
} satisfies ChartConfig;

export function ExampleTrackerLoading() {
  return (
    <Tracker
      data={[]}
      config={chartConfig}
      statusKey="status"
      labelKey="date"
      isLoading
      className="w-full max-w-xl"
    />
  );
}

```

Pass `isLoading` to draw neutral blocks with the same loading treatment as the other Honest UI charts.

## API Reference [#api-reference]

<ApiHeading>
  Tracker
</ApiHeading>


  ### `data`

type: `TData[]`

One row per block, oldest first.

  ### `config`

type: `ChartConfig`

One entry per status, with its label and colors.

  ### `statusKey`

type: `keyof TData & string`

The status of each block, matching a `config` key.

  ### `labelKey`

type: `keyof TData & string`

The tooltip heading and accessible name of each block, such as a date.

  ### `valueKey`

type: `keyof TData & string`

An optional value shown beside the status, such as uptime.

  ### `valueFormatter`



string">
    Formats the `valueKey` value.

  ### `detailFormatter`



ReactNode">
    Extra tooltip text for a block, such as an incident summary.

  ### `height`

type: `number` · default: `32`

Block height in pixels.

  ### `gap`

type: `number` · default: `2`

Gap between blocks in pixels.

  ### `radius`

type: `number` · default: `2`

Block corner radius in pixels.

  ### `emptyLabel`

type: `string` · default: `&#x22;No data&#x22;`

The label for a block without a known status.

  ### `tooltip`

type: `boolean` · default: `true`

Shows a tooltip on hover and focus.

  ### `tooltipVariant`

type: `&#x22;default&#x22; | &#x22;frosted-glass&#x22;` · default: `&#x22;default&#x22;`

The tooltip surface.

  ### `tooltipRoundness`

type: `&#x22;sm&#x22; | &#x22;md&#x22; | &#x22;lg&#x22; | &#x22;xl&#x22;` · default: `&#x22;lg&#x22;`

The tooltip corner radius.

  ### `showLegend`

type: `boolean` · default: `false`

Lists the statuses under the blocks.

  ### `legendVariant`

type: `LegendVariant` · default: `&#x22;rounded-square&#x22;`

The legend indicator shape, shared with the other charts.

  ### `onBlockClick`



) => void">
    Called when a block is clicked or activated from the keyboard.

  ### `animation`

type: `boolean` · default: `true`

Fades the blocks in on mount. Reduced-motion preferences disable it.

  ### `isLoading`

type: `boolean` · default: `false`

Draws placeholder blocks and a loading label.

  ### `loadingBlocks`

type: `number` · default: `45`

Number of placeholder blocks.

  ### `ariaLabel`

type: `string`

Accessible name for the list. A status count is generated when omitted.

  ### `className`

type: `string`

Classes for the container.
