Dither Heatmap
betaA rows × columns intensity grid drawn in dithered tiles that morph between periods, with a keyboard-navigable cell readout.
- Data
- 1 file
- 1 npm package
- Accessibility notes
- Draws on a canvas
pnpm dlx @dowel-ui/cli add dither-heatmapnpm packages installed: class-variance-authority.
import { HEATMAP } from "@/components/ui/dither-heatmap";Default
Activity Dither Heatmap
Gallery
Continuous
With Visible Table
Static
<DitherHeatmap>
| Prop | Type | Default |
|---|---|---|
columns (required)Column names, start to end (e.g. hours or weeks). | readonly string[] | — |
label (required)What the chart shows. Names the image, the grid and the data table. | string | — |
rows (required)Row names, top to bottom (e.g. weekdays). | readonly string[] | — |
values (required)
| readonly (readonly number[])[] | — |
activeCellThe cell whose readout shows (controlled); null hides it. | DitherHeatmapCell | null | — |
animate | boolean | true |
cellCell pitch in CSS pixels. Default 3: tiles are small. | number | 3 |
colorColour token or CSS colour expression. Default "primary". | string | "primary" |
defaultActiveCell | DitherHeatmapCell | null | null |
descriptionReplaces the generated summary in the image's accessible name. | string | — |
formatCellThe readout for one cell. Defaults to "Row, Column: value". | (cell: DitherHeatmapCellInfo) => string | — |
formatValue | (value: number) => string | formatDitherValue |
lessLabel | string | "Less" |
levelsQuantise intensity into this many steps (amicro's activity map uses 5). | number | — |
maxValue of a full-intensity tile. Defaults to the largest value. | number | — |
moreLabel | string | "More" |
onActiveCellChange | (cell: DitherHeatmapCell | null) => void | — |
rowLabelHeader of the data table's row-name column. | string | "Row" |
showAxisShow row and column labels. | boolean | true |
showLegendShow a Less → More scale. | boolean | false |
showTableShow the data table. It is always present for assistive technology. | boolean | false |
size | "sm" | "md" | "lg" | "md" |
Plus every attribute of <div> except children.
9/9
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes