Skip to content

Props

Data

PropTypeDefaultDescription
dataHeatmapData[]Activity data. Accepts array [{ date, value }] or object map { 'YYYY-MM-DD': value }.

Date Range

PropTypeDefaultDescription
range'year' | 'month' | '3months' | '6months'Shorthand range preset. Takes precedence over startDate/endDate.
startDatestring | Date1 year agoStart of visible range.
endDatestring | DatetodayEnd of visible range.

Colors & Scale

PropTypeDefaultDescription
scaleMode'levels' | 'gradient''levels'Color scale mode.
levelsnumber5Number of color levels. Clamped to 2–10.
colorPreset'github' | 'blue' | 'orange' | 'red' | 'purple' | 'teal'Built-in palette (light/dark aware).
colorsstring[]theme defaultsColors for each level. Index 0 = empty day.
colorFromstring'#9be9a8'Gradient start color (gradient mode).
colorTostring'#216e39'Gradient end color, or target color for auto-generated palette.
maxValuenumberautoMax value for scale. Auto-computed from data if omitted.
emptyColorstringtheme defaultBackground color for days with no data.

Appearance

PropTypeDefaultDescription
theme'light' | 'dark' | 'auto''auto'Built-in color theme.
cellSizenumber | string12Cell size in px or CSS string ('1rem').
cellGapnumber | string3Gap between cells.
cellRadiusnumber | string2Cell border radius. Use 50 for circles.
weekStart0–61First day of week. 0 = Sunday, 1 = Monday.
orientation'horizontal' | 'vertical''horizontal'Layout direction. Vertical stacks weeks top-to-bottom (weekdays on top, months on left).
showWeekdaysbooleantrueShow day-of-week labels.
showMonthsbooleantrueShow month labels.
showLegendbooleantrueShow color-scale legend.
legendLabelstring''Text label shown next to the legend.
stickyWeekdaysbooleantrueKeep weekday labels pinned during horizontal scroll.

Today Highlight

PropTypeDefaultDescription
todayboolean | TodayOptionsfalseHighlight today's cell. true uses defaults (ring, blue, 2px).

TodayOptions shape

ts
interface TodayOptions {
  color?: string                          // highlight color (default: '#0969da' / '#58a6ff' in dark)
  style?: 'ring' | 'fill'  // visual style (default: 'ring')
  size?:  number           // thickness in px (default: 2)
}
StyleDescription
ringInset border around the cell
fillFills the cell with color, overriding the heat color

Tooltip

PropTypeDefaultDescription
tooltipEnabledbooleantrueEnable hover tooltip.
tooltipFormatter(day: HeatmapDay) => stringbuilt-inCustom tooltip text.

Localization

PropTypeDefaultDescription
localeHeatmapLocaleEnglishMonth names, weekday names, labels.
dateFormatstring | ((date: string) => string)'YYYY-MM-DD'Date display format. Tokens: YYYY, MM, DD.

HeatmapLocale shape

ts
interface HeatmapLocale {
  months?:        [string × 12]  // full month names
  monthsShort?:   [string × 12]  // abbreviated month names
  weekdays?:      [string × 7]   // full day names (index 0 = Sunday)
  weekdaysShort?: [string × 7]   // abbreviated day names
  noDataLabel?:   string          // label for empty days in tooltip
  formatDate?:    (date: string) => string  // custom date formatter
}