Skip to documentation content

Tracker

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

Basic Tracker

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 or a Sparkline instead.

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

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

npm install honestui

Usage

import { Tracker, type ChartConfig } from "honestui/charts";
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

One row per service

Status page

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

isLoading='true'

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

API Reference

Tracker
PropTypeDefaultDescription
data*TData[]โ€“

One row per block, oldest first.

config*ChartConfigโ€“

One entry per status, with its label and colors.

statusKey*keyof TData & stringโ€“

The status of each block, matching a config key.

labelKey*keyof TData & stringโ€“

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

valueKeykeyof TData & stringโ€“

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

valueFormatter(value: number) => stringโ€“

Formats the valueKey value.

detailFormatter(datum: TData) => ReactNodeโ€“

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

heightnumber32

Block height in pixels.

gapnumber2

Gap between blocks in pixels.

radiusnumber2

Block corner radius in pixels.

emptyLabelstring"No data"

The label for a block without a known status.

tooltipbooleantrue

Shows a tooltip on hover and focus.

tooltipVariantdefault|frosted-glass"default"

The tooltip surface.

tooltipRoundnesssm|md|lg|xl"lg"

The tooltip corner radius.

showLegendbooleanfalse

Lists the statuses under the blocks.

legendVariantLegendVariant"rounded-square"

The legend indicator shape, shared with the other charts.

onBlockClick(block: TrackerBlock<TData>) => voidโ€“

Called when a block is clicked or activated from the keyboard.

animationbooleantrue

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

isLoadingbooleanfalse

Draws placeholder blocks and a loading label.

loadingBlocksnumber45

Number of placeholder blocks.

ariaLabelstringโ€“

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

classNamestringโ€“

Classes for the container.