Skip to content
nexubDesign System
v11.9.0

Components · Data Display

Heatmap

BetaAdded v4.5.0

Intensity over a grid, such as activity by weekday and week, in seven sequential steps.

import { Heatmap } from '@nexub/react';
View as Markdown

Playground

Props

Payments sent per day, last 16 weeks
Mon0369147102584710135
Tue71025803691411146912
Wed3691471025807101358
Thu1025803691471469124
Fri69147102580310135811
TSX
<Heatmap className="w-full" rowLabels={days} data={data} title="Payments sent per day, last 16 weeks" />

Examples

Weekly activity

Payments sent per day, last 16 weeks
Mon0369147102584710135
Tue71025803691411146912
Wed3691471025807101358
Thu1025803691471469124
Fri69147102580310135811

Missing cells and legend

`null` cells are hatched; `legend` shows the scale.

Deploys by day and week
Mon25—394
Wed61710—5
Fri38461—
Show as table
Deploys by day and week
LabelW1W2W3W4W5W6
Mon25—394
Wed61710—5
Fri38461—

States

  • Payments sent per day, last 16 weeks
    Mon0369147102584710135
    Tue71025803691411146912
    Wed3691471025807101358
    Thu1025803691471469124
    Fri69147102580310135811
    default
  • loading

Props

Props
PropTypeDefaultDescription
datarequired(number)[][]—Rows of values. 11.3: a missing cell (null, undefined or a hole) is drawn hatched, listed as "—" and left out of the colour range.
rowLabelsrequiredstring[]—One label per row.
columnLabelsstring[]—Used in the hover text.
titlerequiredstring—Accessible name and table caption.
legendboolean—11.3: a low → high scale under the grid with the min and max values, plus a "No data" swatch when cells are missing.
tableViewstring | boolean—11.3: a "Show as table" disclosure under the drawing with the same data; a string sets its label.
emptyStateReact.ReactNode—Shown when there is no data. Defaults to the "no data" message.
errorStateReact.ReactNode—Shown in place of the data when a load failed, for example an ErrorState with a retry action. Wins over loading and empty.
interactiveboolean—A crosshair and tooltip that follow the pointer, and arrow-key navigation between points.
loadingboolean—Shows a skeleton in place of the data and sets aria-busy.
onPointClick((point: HeatmapPoint) => void)—Click, tap, or Enter/Space on a point. Turns interactive on unless it is set to false.
valueFormat((value: number) => string)fmt

Accessibility

Screen reader

  • The drawing is hidden from assistive tech; a visually hidden table or caption carries every value.

On iOS & Android