# Token usage chart

Daily token use with one comparison or stacked parts, and figures for the selected period.

Live variants: https://design.arcadia.is/components/token-chart

```tsx
import { TokenChart } from "@arcadia/ui";
```

```tsx
import { TokenChart } from "@arcadia/ui";

<TokenChart subsetLabel="Selected project" stats={[
    { label: "Total usage", value: "3.37M" },
    { label: "Avg. daily", value: "1.12M" },
    { label: "Estimated cost", value: cost(12.4) },
  ]} data={{ state: "ready", days: [
    { day: "2026-11-14", total: 1_160_000, subset: 220_000 },
    { day: "2026-11-15", total: 1_240_000, subset: 0 },
    { day: "2026-11-16", total: 970_000, subset: 140_000 },
  ] }} />
```

## Accessibility

Tab to the plot, then use arrow keys to read a day. Home and End jump to the ends, and Escape dismisses the readout. Touch users can tap or drag sideways without blocking vertical page scroll. The accessible daily table gives exact counts for every supplied day.

Chart marks never animate in. The readout uses the shared tooltip motion, with no travel in reduced motion and no entrance from the keyboard.

## API reference

### TokenChart

- `data` (`TokenChartData`, required)
- `caption` (`string`)
- `subsetLabel` (`string`)
- `parts` (`readonly TokenChartPart[]`)
- `highlight` (`string | null`, default `null`)
- `legend` (`boolean`, default `false`)
- `baseline` (`boolean`, default `false`)
- `rangeLabels` (`boolean`, default `false`)
- `range` (`{ value: TokenChartRange; onChange: (range: TokenChartRange) => void }`)
- `stats` (`readonly TokenChartStat[]`)
- `level` (`"stream" | "nested"`)
- `nesting` (`"contained-object"`): A separately framed object that belongs inside another one, not a layout wrapper.
- `variant` (`"default" | "inset" | "window"`)
- `mono` (`boolean`)
- `lifted` (`boolean`)
- `dropTarget` (`boolean`)
- `drag` (`"ghost" | "slot"`)
- `rootStyle` (`CardStyle`)

Rest props go to `<div>` props and `render`.
