Skip to content

Activity heatmap

See a year of activity at a glance, one square per day.

DataChartCalendar
npx shadcn@latest add @silicon-ui/activity-heatmap

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/activity-heatmap

Manually

  1. Install the dependencies

    npm install motion
  2. Copy these files into your project

    • components/silicon-ui/activity-heatmap/activity-heatmap.tsx
    • components/silicon-ui/activity-heatmap/activity-heatmap.module.css
  3. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
import { ActivityHeatmap } from "@/components/silicon-ui/activity-heatmap/activity-heatmap";

API reference

PropTypeDefault
days*

One entry per day, oldest first. Days missing inside the range count as zero.

ActivityDay[]—
label*

Accessible name for the grid, such as "Contributions in 2025".

string—
period*

Finishes the summary line: "1,284 contributions in {period}".

string—
unit

Nouns for the count.

{ one: string; other: string }CONTRIBUTIONS
thresholds

Upper bounds for levels one to three; anything above the last is level four. Defaults to quarters of the busiest day.

[number, number, number]—
weekStartsOn0 | 1

01

0
selectedDatestring | nullnull
onSelectDate(date: string) => void—
actions

Controls beside the summary, such as a range switch.

ReactNode—
locale

Formatting locale. Fixed by default so server and client render the same labels.

string"en-US"
classNamestring—

Dependencies

npm
motion
Registry
silicon-motion-tokens