Excited to officially launch our new shadcn-based component!🎉
Modern alternative to primitive react heatmaps.
February 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 1 |
Showcase Github streaks. Visualise user growth. Understand global warming trends.
Convey more with less.
Unstyled. Customizable. Open Source.
import { CalendarHeatmap } from "@/components/ui/calendar-heatmap" // Github-style streak pattern <CalendarHeatmap variantClassnames={[ "text-white hover:text-white bg-green-400 hover:bg-green-400", "text-white hover:text-white bg-green-500 hover:bg-green-500", "text-white hover:text-white bg-green-700 hover:bg-green-700", ]} datesPerVariant={[ [new Date('Jan 1, 2024'), new Date('Jan 15, 2024'), new Date('Feb 18, 2024')], [new Date('Jun 12, 2024'), new Date('July 1, 2024'), new Date('Feb 29, 2024'), new Date('May 4, 2024')], [new Date('Jan 19, 2024'), new Date('Apr 14, 2024')], ]} /> // Or you may simply pass weighted array of dates, // and they would be slotted to different variants based on length of `variantClassnames` <CalendarHeatmap variantClassnames={[ "text-white hover:text-white bg-green-400 hover:bg-green-400", "text-white hover:text-white bg-green-500 hover:bg-green-500", "text-white hover:text-white bg-green-700 hover:bg-green-700", ]} weightedDates={[ { date: new Date('Jan 1, 2024'), weight: 2 }, { date : new Date('Jan 15, 2024'), weight: 1.5 }, { date: new Date('Jun 12, 2024'), weight: 8 } , { date: new Date('July 1, 2024'), weight: 5 }, { date: new Date('Jan 19, 2024'), weight: 6 }, { date: new Date('Apr 19, 2024'), weight: 13.5 } ]} /> // Component code at https://github.com/gurbaaz27/shadcn-calendar-heatmap/blob/main/components/ui/calendar-heatmap.tsx
import { CalendarHeatmap } from "@/components/ui/calendar-heatmap" // Github-style streak pattern <CalendarHeatmap variantClassnames={[ "text-white hover:text-white bg-green-400 hover:bg-green-400", "text-white hover:text-white bg-green-500 hover:bg-green-500", "text-white hover:text-white bg-green-700 hover:bg-green-700", ]} datesPerVariant={[ [new Date('Jan 1, 2024'), new Date('Jan 15, 2024'), new Date('Feb 18, 2024')], [new Date('Jun 12, 2024'), new Date('July 1, 2024'), new Date('Feb 29, 2024'), new Date('May 4, 2024')], [new Date('Jan 19, 2024'), new Date('Apr 14, 2024')], ]} /> // Or you may simply pass weighted array of dates, // and they would be slotted to different variants based on length of `variantClassnames` <CalendarHeatmap variantClassnames={[ "text-white hover:text-white bg-green-400 hover:bg-green-400", "text-white hover:text-white bg-green-500 hover:bg-green-500", "text-white hover:text-white bg-green-700 hover:bg-green-700", ]} weightedDates={[ { date: new Date('Jan 1, 2024'), weight: 2 }, { date : new Date('Jan 15, 2024'), weight: 1.5 }, { date: new Date('Jun 12, 2024'), weight: 8 } , { date: new Date('July 1, 2024'), weight: 5 }, { date: new Date('Jan 19, 2024'), weight: 6 }, { date: new Date('Apr 19, 2024'), weight: 13.5 } ]} /> // Component code at https://github.com/gurbaaz27/shadcn-calendar-heatmap/blob/main/components/ui/calendar-heatmap.tsx
Examples
Github Streaks
February 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 1 |
March 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
23 | 24 | 25 | 26 | 27 | 28 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | 1 | 2 | 3 | 4 | 5 |
April 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
30 | 31 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 1 | 2 | 3 |
Temperature Heatmap
February 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 1 |
Rainbow Colors
February 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 1 |
March 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
23 | 24 | 25 | 26 | 27 | 28 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | 1 | 2 | 3 | 4 | 5 |