SYS:ONLINE● ACTIVE
THEME
GITHUBv0.1.0

HEATMAP

Grid of colored cells showing density or activity over time. Opacity scales linearly with value. Supports row and column labels.

PREVIEW

UPTIME GRID — LAST 7 DAYS
00h
06h
12h
18h
MON
TUE
WED
THU
FRI
SAT
SUN

INSTALLATION

BASH
npx shadcn@latest add @scificn/heatmap

USAGE

TSX
import { Heatmap, type HeatmapCell } from '@/ui/heatmap'

// Simple number array
const data = [0, 10, 40, 80, 100, 60, 20, 5, 90, 100, 70, 30]

<Heatmap data={data} columns={6} title="ACTIVITY" variant="GREEN" />

// With cell labels (shown as native tooltip on hover)
const labeled: HeatmapCell[] = data.map((v, i) => ({
  value: v,
  label: `Week ${i + 1}: ${v}%`,
}))

<Heatmap data={labeled} columns={6} variant="AMBER" />

VARIANTS

variant="GREEN"
variant="AMBER"
variant="RED"

PROPS

PROPTYPEDEFAULTDESCRIPTION
dataHeatmapCell[] | number[]Flat array of cells, filled left-to-right, top-to-bottom.
columnsnumberNumber of columns in the grid.
variantGREEN | AMBER | RED"GREEN"Color scale applied to cell intensity.
maxnumbermax(data)Override the normalization maximum.
cellSizenumber16Cell width and height in pixels.
rowLabelsstring[]undefinedLabels shown to the left of each row.
colLabelsstring[]undefinedLabels shown above each column.
titlestringundefinedHeader label shown at the top.
classNamestringAdditional classes merged via cn().

HEATMAPCELL FIELDS

PROPTYPEDEFAULTDESCRIPTION
valuenumberRaw value. Normalized against max to compute opacity.
labelstringundefinedTooltip text shown on hover (native browser title).