CalendarHeatmap

Calendar heatmap — a week-column grid of day cells colored by value (GitHub-style).

Category: chart · WCAG 2.1-AA · chart, calendar, heatmap, time, data-viz

Props

PropTypeDefaultDescription
dataCalendarHeatmapDatum[]Days: { day: string | Date, value }.
titlestringTitle text for the component.
descriptionstringSupporting description text.
fromstring | DateRange start (defaults to min day).
tostring | DateRange end (defaults to max day).
widthnumberFixed SVG width in px. ⚠ **Omit for a responsive chart** — the chart fills and tracks its container via a ResizeObserver; there is no correct pixel number in a responsive grid. A fixed width is clamped to the container (max-inline-size: 100%) so it can never overflow its card, but it also stops the chart growing. `useChartSize` is NOT needed for this — charts call it internally.
heightnumber160SVG height in px. Unlike `width`, height does NOT track the container — this is the knob you set to change the chart's aspect. It is a **cap on the drawn grid, never a crop**: cell size is clamped so all seven weekday rows fit inside it.
maxCellSizenumberOptional ceiling on a cell's edge, in px. Cells are already clamped to fit `height`; set this only to keep them small in a short, wide range (GitHub's calendar uses ~11). Omitted by default so the height budget alone decides.
tooltipbooleanWhether to show tooltips on hover.
classNamestringAdditional CSS class names merged onto the root element.
plainbooleanfalseWhen true, renders a minimal variant without chart chrome.
visualMapVisualMapOptionsMap day value → CVD-safe colour (continuous or piecewise) via a keyboard-operable legend that filters the visible range.

Design tokens

When to use

When not to use

Examples

Contribution calendar

import { CalendarHeatmap } from '@cascivo/charts'

<CalendarHeatmap
  title="Activity"
  data={[{ day: '2026-01-01', value: 3 }, { day: '2026-01-02', value: 7 }]}
/>

Related components

← Back to docs