sigilUI

Heatmap Grid

Map values to color intensity across a grid.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import { HeatmapGrid } from "@sigil-ui/components";

Usage

<HeatmapGrid
    xLabels={["Mon", "Tue", "Wed", "Thu", "Fri"]}
    yLabels={["9am", "12pm", "3pm", "6pm"]}
    data={[
      [{ value: 2 }, { value: 5 }, { value: 8 }, { value: 3 }, { value: 1 }],
      [{ value: 7 }, { value: 9 }, { value: 4 }, { value: 6 }, { value: 3 }],
      [{ value: 4 }, { value: 3 }, { value: 6 }, { value: 8 }, { value: 5 }],
      [{ value: 1 }, { value: 2 }, { value: 3 }, { value: 4 }, { value: 7 }],
    ]}
  />

Props

PropTypeDefaultDescription
dataHeatmapCell[][]——
xLabelsstring[]——
yLabelsstring[]——
minnumber—Minimum value (maps to lowest intensity).
maxnumber—Maximum value (maps to highest intensity).
colorstringvar(--s-primary)Color for the high-intensity end.
cellSizenumber40Cell size in px.

Token integration

CSS VariablePurpose
--s-primaryPrimary
--s-font-monoFont mono
--s-text-mutedText muted
--s-radius-smRadius sm
--s-primary-contrastPrimary contrast