Heat Calendar

Composable activity calendar with Grid, Legend, and Tooltip parts, controlled range selection, and UTC calendar dates. Supply weekly intensities to visualize activity and total a selected span.

Preview

 lessmore

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/heat-calendar

API Reference

HeatCalendar

unit?
string

Noun after every count, e.g. "commits", "ships".

weeks?
number

Number of week columns.

maxCount?
number

Count a cell at intensity 1 stands for; a cell reads `intensity × maxCount`.

values?
{}

`values[week][day]` intensities in 0..1, seven days per week. Missing values are zero.

endDate?
any

Last UTC calendar day of the grid. Defaults to today after mount; explicit dates render identically in every timezone.

color?
string

The single hue. Any CSS color; magnitude maps to its strength, never to a second color.

className?
string
selection?
HeatCalendarSelection | null

Controlled selection; null clears it. Cell coordinates are zero-based week/day (Monday first).

defaultSelection?
HeatCalendarSelection | null
onSelectionChange?
((selection: HeatCalendarSelection | null) => void)

HeatCalendarGrid

className?
string

HeatCalendarLegend

className?
string

HeatCalendarTooltip

className?
string

Contributed by

Savva

Updated