Contribution Graph
A composable calendar heatmap for showing daily activity across weeks and months.
Overview
Use a contribution graph to show daily activity over a long period: commits, workouts, orders, or support load. Each day is a cell in a week column, so streaks, weekly rhythms, quiet seasons, and holidays stand out at a glance. It answers "how consistent was this?" better than a line chart, which hides the day-of-week pattern.
Anatomy
ContributionGraph owns the daily data, the date range, the first day of the week, and the loading state. Every day in the range is drawn; days without data are empty. Add Cells for size, gaps, and levels, Months and Weekdays for labels, Legend for the "Less … More" scale, and Tooltip for the date and value of a day. Rows on the same day add up.
Cells take discrete levels from the value's config color: a single color steps from 30% to full opacity, and a multi-stop color uses one stop per level. The empty level is a faint wash of the foreground.
Accessibility
When ariaLabel is omitted, the generated name gives the date range, the total, and the number of active days. Levels differ in lightness as well as hue, and the legend shows every level in order. The tooltip is pointer-operated, so summarize streaks, totals, or busy days in nearby text when people need them.
Installation
Usage
The data has one row per day, or several rows per day that add up. dateKey holds a YYYY-MM-DD string, a timestamp, or a Date.
import { ContributionGraph, type ChartConfig } from "honestui/charts";<ContributionGraph
data={data}
config={chartConfig}
dateKey="date"
valueKey="commits"
range={2025}
>
<ContributionGraph.Months />
<ContributionGraph.Weekdays />
<ContributionGraph.Legend />
<ContributionGraph.Tooltip />
<ContributionGraph.Cells />
</ContributionGraph>Without range, the graph shows the 52 weeks ending on the latest day in data. Cells grow to fill the container's width, up to maxSize, and the whole block is centered.
Thresholds and Week Start
By default, levels split the range from zero to the busiest day evenly. Pass thresholds to set the lower bound of each level yourself, which keeps levels stable as data changes. This example starts weeks on Monday, labels every weekday, uses a four-stop color, and renames the legend ends.
Loading State
Pass isLoading to reserve the layout with a neutral cell pattern and the same loading treatment as the other Honest UI charts.