Simulates prefers-reduced-motion for the demo. Off follows your system setting.
Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.
1
| 00h | 02h | 04h | 06h | 08h | 10h | 12h | 14h | 16h | 18h | 20h | 22h | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Mon | 9 | 10 | 6 | 31 | 70 | 118 | 125 | 138 | 103 | 87 | 32 | 18 |
| Tue | 0 | 18 | 0 | 37 | 66 | 120 | 124 | 137 | 105 | 84 | 38 | 12 |
| Wed | 4 | 13 | 6 | 29 | 75 | 111 | 134 | 127 | 116 | 73 | 48 | 2 |
| Thu | 15 | 2 | 17 | 19 | 84 | 103 | 140 | 122 | 120 | 70 | 49 | 2 |
| Fri | 17 | 1 | 16 | 22 | 80 | 108 | 134 | 129 | 111 | 80 | 39 | 13 |
| Sat | 8 | 11 | 5 | 24 | 40 | 72 | 69 | 84 | 57 | 56 | 18 | 18 |
| Sun | 0 | 18 | 0 | 28 | 37 | 73 | 69 | 82 | 60 | 51 | 24 | 11 |
A grid of soft cells whose shade shows each value.
npx shadcn@latest add ikislay/pixel-ui/heatmapimport { Heatmap } from "@/components/ui/heatmap"export function Demo() {return (<Heatmaplabel="Orders by day and shift"rows={["Mon", "Tue", "Wed"]}columns={["Morning", "Noon", "Evening"]}data={[[12, 30, 18],[9, 26, 22],[14, 34, 27],]}/>)
1// Loading…
Options you can pass to customize this component.
data*number[][]One array of values per row, in column order.
rows*string[]Labels down the left side.
columns*string[]Labels across the top. Some are skipped when the grid is too narrow to fit them all.
label*stringNames the chart for screen readers and captions its data table.
format(value: number) => stringFormats values wherever the chart shows them. Defaults to short numbers like 12.4K.
colorstringAny CSS color. The lowest value shows a faint tint of it and the highest shows it in full.
gapnumberSpace between cells in pixels.
classNamestringMerged onto the root element.