Skip to content

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'

On this page
  1. Deploys in a year
  2. Skeleton
  3. When to use it
  4. For everyone
  5. Props

Deploys in a year

Deploys
Every day of 2026
Mon
Tue
Wed
Thu
Fri
Sat
Sun
View as table
TotalDays with activity
January 20263115
February 20262912
March 20262714
April 20262916
May 20263415
June 20262313
July 20263819
August 20263617
September 20264018
October 20268218
November 20269218
December 202610520
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
TotalDays with activity
September 202641
October 2026112
November 2026121
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

CalendarHeatmapTypeDefault
fromrequired

The first and last day shown, as «2026-01-01».

string
titlerequired ReactNode
torequired string
valuesrequired

By 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
subtitle

What is plotted and in what unit: «Requests per minute, last 24 hours».

ReactNode
unit

What is counted, for the tooltip and the table: «deploys».

string
weekStart

1 for weeks that start on Monday, 0 for Sunday.

0 | 1 1
CalendarHeatmapSkeletonTypeDefault
weeks number 53
  1. Deploys in a year
  2. Skeleton
  3. When to use it
  4. For everyone
  5. Props

    Search pages, sections and terms