# CoverageStrip (/docs/charts/coverage-strip)

CoverageStrip answers "can I trust this data — where was nothing measured?". Measured slots are filled; gaps are hollow
with a hairline outline. The distinction between `null` (no measurement) and `0` (a measured zero) is the whole chart,
and it is carried by **shape**, so it survives forced-colors and print. Nothing is ever interpolated across a gap.

```tsx
<CoverageStrip
  data={[3, 4, null, 5, 0, null, null, 6, 8, 7, null, 9, 11, 10]}
  expected={18}
  label="percent"
  title="Sensor uptime"
  width={240}
  height={16}
/>
```

## Install

```tsx
import { CoverageStrip } from "@microcharts/react/coverage-strip";

<CoverageStrip data={readings} expected={18} label="percent" title="Sensor uptime" />
```

Setup (package + stylesheet): [Quickstart](/docs/quickstart#set-up-with-an-ai-agent) or paste [`/agent-setup.md`](/agent-setup.md) into your agent.


## When to use it

- **Good for** — data-quality cells beside a metric, sensor-uptime rows, trailing-gap detection.
- **Avoid for** — magnitude over time (HeatStrip) or exact values (Sparkline).


## Variants

```tsx
const readings = [3, 4, null, 5, 0, null, 6, 8, 7, null, 9, 11];

<CoverageStrip data={readings} mode="intensity" domain={[0, 12]} />
<CoverageStrip data={readings} shape="round" />
```

```tsx
<CoverageStrip
  data={[3, 4, null, 5, 0, null, null, 6, 8, 7, null, 9, 11, 10]}
  expected={18}
  label="percent"
  locale="de-DE"
/>
```

`locale` formats the coverage percentage in the gutter and the accessible summary — the strip above reads "56 %" (German
percent spacing) instead of "56%". `format` shapes the measured values the interactive entry announces.

## Edge cases

```tsx
// an array that simply stops is the worst gap of all — expected beyond
// data.length pads the tail with hollow "no measurement" slots
<CoverageStrip data={[1, 1, 1]} expected={8} label="percent" />
```

```tsx
<CoverageStrip data={[3, 0, null, 5]} />
```

```tsx
<CoverageStrip data={[]} />
```


## Why this default

Shape carries the presence/absence distinction, not just color, so it survives forced-colors and print. A measured `0`
is a filled cell like any other value; only `null` (no record) is hollow — the two never look the same. `expected` lets
a trailing shortfall count as coverage loss: a feed that simply stops reporting is the worst gap of all, so it isn't
silently dropped from the denominator. Nothing is ever interpolated across a gap — a missing slot stays visibly empty
rather than being smoothed into its neighbors.

## Accessibility

The accessible name states how many slots were measured, the coverage percentage, and the longest gap — **"10 of 18
slots measured (56 %); longest gap 4 slots."** An empty series states "No data." instead. The interactive entry roves
slots with ←/→, announcing each one as a measured value or "no measurement".

The interactive entry follows the shared [interaction contract](/docs/accessibility#one-interaction-contract):
arrow keys rove between units on both axes, `Home` and `End` jump to the ends, and a click, tap, `Enter` or
`Space` selects a unit — pinning its readout so it survives blur, until you select it again or press `Escape`.
On touch, a tap pins and a drag scrubs.

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `data` (required) | `(number \| null)[]` | Time-ordered slots; null = no measurement, 0 = a measured zero. |
| `expected` | `number` | Slots the window should contain — lets trailing missingness count. |
| `mode` | `"binary" \| "intensity"` | Presence only (default), or shade measured cells by value. |
| `steps` | `number` | Intensity granularity (default 5). |
| `shape` | `"square" \| "round" \| "dot"` | Cell shape from the shared vocabulary (default 'square'). |
| `label` | `"percent" \| "none"` | State the coverage number in a right gutter. |
| `animate` | `boolean` | (interactive) Opt-in entrance motion when the chart mounts client-side — add `import "@microcharts/react/motion"` once. Inert on the server, on hydrated server HTML, and under `prefers-reduced-motion`. |

Plus the shared grammar — `data`, `domain`, `color`, `title`, `summary`, `format` — and the layout props (`width`, `height`, `className`, `style`) that every chart accepts. Interactive entries also share `animate` and `live`, and — wherever a chart has more than one navigable unit — `onActive`, `onSelect`, `selectedIndex` and `defaultSelectedIndex`; and — wherever the chart shows a hover value — `readout`. See [the shared grammar](/docs/quickstart#the-shared-grammar).
