Heatmap: when the work happens, by weekday and hour
Heatmap draws values on a grid, such as weekdays by hours or weekdays by weeks, in six steps of one hue, with empty cells in quiet grey and a scale from less to more under it. Every cell is reachable with the arrow keys and shows its value, and a table carries them all for screen readers.
By Bohuslav PoláčekChecked
What it is for, and what the preview shows
Intensity over a week: when the loading bays are busiest, which days someone trains, when the phones ring. The preview holds two heatmaps from the demo, rebuilt from the kit with its numbers. On the left, Ridgeway Freight's loadings by weekday and hour from 5:00 to 21:00 over the last seven days: the deepest cells sit from 6:00 to 9:00 on weekdays, Saturday stays light, and Sunday has one loading an hour from 6:00 to 9:00 and none after. On the right, the minutes Martin Kerr trained on each weekday over the last 12 weeks, the weeks labelled by their Monday: Tuesday has training in all 12, and the days without any are the quiet grey of an empty cell, as are this week's days from today on.
Both label every second column, as the demo asks with columnLabelEvery, so the labels stay readable when the cells are narrow.
The rules, and where they live
- The manifest: use it for activity by weekday and hour, or a year of days; not for exact values (
DataTable). It replaces "a hand-built grid of coloured cells". - docs/patterns.md, Data: colour by job: magnitude is one sequential hue in steps (
seq-1…6), identity thechart-1…8slots, state the status colours; intensity by day and hour is theHeatmap, with Ridgeway's reports as the example. - docs/principles.md, Charts: one measure is one hue of the sequential scale; every chart has a table for screen readers and works with the arrow keys.
- AGENTS.md, Charts: charts in cards fill them (
ChartCard) and load asChartSkeleton. - AGENTS.md, Tokens only: colours come from the kit's OKLCH generator in light and dark; a hex, rgb or oklch value typed into a component fails
npm run check:tokens.
What AI coding tools write instead
A hand-built grid of coloured cells, as the manifest's replaces names it. What goes wrong:
- The colour is one brand colour with its opacity set by the value, so a cell's colour depends on what lies behind it and the faint cells vanish in dark mode. The kit uses six fixed steps of one hue from its tokens, made for light and dark.
- A zero gets the faintest colour, so nothing and a little look alike. The kit draws a cell with nothing in it in the page's quiet grey.
- Without a scale nobody knows what the deepest cell means. The kit's scale under the grid runs from less to more, and every cell shows its value on hover or focus.
- In a wide card the cells stretch into slabs. The kit's cells are at most 28px wide, so they stay near square.
- The grid is a set of coloured boxes and nothing else, so a screen reader gets nothing. The kit's cells are reachable with the arrow keys, and a table carries every value.
How to use it
rowsandcolumns: the labels, top to bottom and left to right, such as weekdays and hours or weekdays and weeks.values:values[row][column]; zero or less is an empty cell.formatValue: how a value reads in the tooltip and the table, such as "75 min", or "no training" for a zero.columnLabelEvery: print every second or third column label, for hours.titleanddescription; put it in aChartCardbeside the other charts.
Its entry in the manifest
| Manifest field | Heatmap |
|---|---|
| What it is | Values on a grid of days or hours in the steps of one hue. |
| Use it for | Activity by weekday and hour, or a year of days. |
| Not for | For exact values (DataTable) |
| It replaces | A hand-built grid of coloured cells |
| Screen types | Overview |
| Import | import { Heatmap } from "@meadowstack-studio/kit"; |
Where it runs in the example apps
| Example app | Modules that render it |
|---|---|
| An app for a haulage company | Reports |
| An app for a sports club | Club |
| An app for one person | Training |
How the demo calls it
<Heatmap
title={tx("Dny s tréninkem", "Training days")}
description={tx(
"Minuty tréninku na jednotlivé dny, posledních 12 týdnů.",
"Minutes of training on each day, over the last 12 weeks.",
)}
rows={[...weekdayShort]}
columns={weeks.map((week) => formatDay(week.start).replace(" ", "\u00a0"))}
values={weekdayShort.map((_, row) => weeks.map((week) => week.minutes[row] ?? 0))}
formatValue={(value) => (value ? `${value} min` : tx("bez tréninku", "no training"))}
columnLabelEvery={2}
/>Questions
What can a heatmap show besides hours?
Any two dimensions with a count or an amount in each cell: weekdays by weeks, as Martin Kerr's training does, or a year of days. For exact values a table is the better choice.
How are the colours chosen?
From one hue of the kit's sequential scale, in six steps, with the same tokens in light and dark mode. Empty cells are the page's quiet grey, and a scale under the grid runs from less to more.
Is it accessible?
Every cell is reachable with the arrow keys and shows its value in a tooltip, and a table carries all the values for screen readers. The values follow formatValue, so a zero can read as no training rather than as a bare number.
Why not a column chart?
A column chart shows one count per period. A heatmap shows a count for every pair, every hour of every weekday, so the pattern across the week shows at a glance where seven column charts would not.
Related
- BarList: a ranking you read from the topComponents
- StatGroup: the key figures at the top of an overviewComponents
- A fleet cost report that ranks every truckScreens
- GanttChart: a project schedule with its links and key datesComponents
- Notice: messages by importance, in one frameComponents
- ResourceTimeline: bookings across resources, hour by hourComponents
Two ways
Build it yourself, or have it built
Build it yourself
Build your app on the framework
Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.
One payment, lifetime updates
Get the frameworkHave it built
Have us build your app
Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.
After launch, Care keeps it improving, from €99 a month.
from €1,990
Describe your app