Activity heatmap
See a year of activity at a glance, one square per day.
npx shadcn@latest add @silicon-ui/activity-heatmapInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/activity-heatmapManually
Install the dependencies
npm install motionCopy these files into your project
- components/silicon-ui/activity-heatmap/activity-heatmap.tsx
- components/silicon-ui/activity-heatmap/activity-heatmap.module.css
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
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 | — |
unitNouns for the count. | { one: string; other: string } | CONTRIBUTIONS |
thresholdsUpper bounds for levels one to three; anything above the last is level four. Defaults to quarters of the busiest day. | [number, number, number] | — |
weekStartsOn | 0 | 1
| 0 |
selectedDate | string | null | null |
onSelectDate | (date: string) => void | — |
actionsControls beside the summary, such as a range switch. | ReactNode | — |
localeFormatting locale. Fixed by default so server and client render the same labels. | string | "en-US" |
className | string | — |
Dependencies
- npm
- motion
- Registry
- silicon-motion-tokens