Heatmap Chart
heatmap-chartA grid of cells whose colour carries a quantity, on TanStack Charts: activity by weekday and hour, scores by team and quarter. Six steps of one hue from the sunken surface to the chart accent, optional values in the cells, and a tooltip on every cell.
import { HeatmapChart } from "@/components/forme/heatmap-chart/heatmap-chart";
const days = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
const hours = ["6am", "9am", "12pm", "3pm", "6pm", "9pm"];
// Deploys by weekday and time of day: busy mid-week mornings, quiet weekends.
const weekday = [6, 9, 11, 10, 7, 2, 1];
const hourly = [0.3, 1.4, 1.1, 1.2, 0.7, 0.2];
const deploys = days.flatMap((day, d) =>
hours.map((hour, h) => ({
day,
hour,
deploys: Math.round(weekday[d]! * hourly[h]! + ((d * 7 + h * 3) % 4)),
})),
);
export function HeatmapChartDemo() {
return (
<div className="w-full rounded-xl border border-border bg-card p-5 lit edge">
<p className="text-caption-1-medium text-muted-foreground">Deploys, last 30 days</p>
<p className="mt-1 text-body-regular text-foreground">Most ship mid-week, before lunch.</p>
<HeatmapChart
className="mt-5"
label="Deploys by weekday and time of day over the last 30 days"
data={deploys}
x="hour"
y="day"
value="deploys"
columns={hours}
rows={days}
showValues
/>
</div>
);
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
HeatmapChart
A grid of cells whose colour carries a quantity: activity by weekday and hour, scores by team and quarter.
| Prop | Type | Default | Description |
|---|---|---|---|
data* | readonly Row[] | — | |
x* | keyof Row & string | — | The column each row falls in: an hour, a weekday, a quarter. |
y* | keyof Row & string | — | The row of the grid it falls in. |
value* | NumericKey<Row> | — | The quantity the cell's colour carries. |
label* | string | — | Accessible name. Say what the grid counts and over what. |
columns | readonly string[] | — | Column order. Defaults to the order the values first appear in data. |
rows | readonly string[] | — | Row order, top to bottom. Defaults to first appearance. |
showValues | boolean | false | Print each value inside its cell. Right for a small grid, noise on a large one. |
formatValue | (value: number) => string | plain | |
height | number | 280 | |
className | string | — |
Related


Chart
The tooltip and legend every Forme chart shares: a floating panel with a colour, a name and a right-aligned value per series, and a row of swatches. Installed with any chart; use them directly to give a chart of your own the same finish.
data display

Composed Chart
Columns and a line on one axis, on TanStack Charts: volume against its target, actuals against the plan. Rounded columns side by side, the line drawn over them, and a band cursor that lists every series in the column.
data display

Histogram Chart
How a set of measurements is distributed, on TanStack Charts. Bins are computed with round edges, the tooltip names each range and its count, and dashed markers put a median or p95 right on the shape.
data display