CalendarHeatmap
One square per day, in weeks, shaded by how much happened: deploys, errors, sign-ups over a year. One colour, from light to strong.
import { CalendarHeatmap, CalendarHeatmapSkeleton } from '@sypnia/ui/react'
Deploys in a year
Deploys
Every day of 2026
Mon
Tue
Wed
Thu
Fri
Sat
Sun
View as table
| Total | Days with activity | |
|---|---|---|
| January 2026 | 31 | 15 |
| February 2026 | 29 | 12 |
| March 2026 | 27 | 14 |
| April 2026 | 29 | 16 |
| May 2026 | 34 | 15 |
| June 2026 | 23 | 13 |
| July 2026 | 38 | 19 |
| August 2026 | 36 | 17 |
| September 2026 | 40 | 18 |
| October 2026 | 82 | 18 |
| November 2026 | 92 | 18 |
| December 2026 | 105 | 20 |
Code
import { CalendarHeatmap } from '@sypnia/ui/react';
// One square per day of the year, shaded by how many deploys there were. Hover or focus a day to read it.
const values: Record<string, number> = {};
const start = new Date(2026, 0, 1);
for (let i = 0; i < 365; i++) {
const d = new Date(start); d.setDate(d.getDate() + i);
const weekday = d.getDay(), seed = (i * 7919) % 97;
const n = weekday === 0 || weekday === 6 ? (seed % 9 === 0 ? 1 : 0) : seed % 6 === 0 ? 0 : (seed % 5) + (i > 280 ? 3 : 0);
if (n) values[`${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`] = n;
}
export default function Deploys() {
return <CalendarHeatmap title="Deploys" subtitle="Every day of 2026" unit="deploys" from="2026-01-01" to="2026-12-31" values={values} />;
} Skeleton
Sign-ups
Mon
Tue
Wed
Thu
Fri
Sat
Sun
View as table
| Total | Days with activity | |
|---|---|---|
| September 2026 | 4 | 1 |
| October 2026 | 11 | 2 |
| November 2026 | 12 | 1 |
Code
import { CalendarHeatmap, CalendarHeatmapSkeleton } from '@sypnia/ui/react';
// A quarter and its skeleton: the same weeks, empty.
export default function Skeleton() {
return (
<div className="sy-stack">
<CalendarHeatmap title="Sign-ups" unit="sign-ups" from="2026-09-01" to="2026-11-30" values={{ '2026-09-14': 4, '2026-10-02': 9, '2026-10-21': 2, '2026-11-17': 12 }} />
<CalendarHeatmapSkeleton weeks={14} />
</div>
);
} When to use it
Use it when
- Habits and rhythms over months: which days are busy, which are quiet.
Do not use it when
- Exact comparisons between days: use BarChart.
- Fewer than a few weeks: a BarChart reads better.
For everyone
- Each day is a cell named with its date and amount; Tab reaches the calendar once and the arrow keys move between days.
- «View as table» sums each month.
Props
| CalendarHeatmap | Type | Default |
|---|---|---|
fromrequiredThe first and last day shown, as «2026-01-01». | string | |
titlerequired | ReactNode | |
torequired | string | |
valuesrequiredBy day, as «2026-11-17»: the amount of that day. Days left out had nothing. | Record<string, number> | |
empty | ReactNode | |
error | ReactNode | |
formatValue | Fmt | |
height | number | |
loading | boolean | |
subtitleWhat is plotted and in what unit: «Requests per minute, last 24 hours». | ReactNode | |
unitWhat is counted, for the tooltip and the table: «deploys». | string | |
weekStart1 for weeks that start on Monday, 0 for Sunday. | 0 | 1 | 1 |
| CalendarHeatmapSkeleton | Type | Default |
|---|---|---|
weeks | number | 53 |