Componentcharts1.22 KB gzipZero dependencies
Calendar Heatmap
GitHub-style Git calendar heatmap grid
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add calendar-heatmapOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { CalendarHeatmap } from "@/components/ui/calendar-heatmap"; <CalendarHeatmap data={data} weeks={8} />Source code
calendar-heatmap.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxcalendar-heatmap.tsx168 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface CalendarHeatmapEntry { date: string; // YYYY-MM-DD value: number;} export interface CalendarHeatmapProps extends React.HTMLAttributes<HTMLDivElement> { data: CalendarHeatmapEntry[]; weeks?: number; height?: number;} function parseUtcYmd(dateStr: string): Date { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(dateStr.trim());Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { CalendarHeatmap } from "@/components/ui/calendar-heatmap"; <CalendarHeatmap />| Prop | Type | Description |
|---|---|---|
| data | CalendarHeatmapEntry[] | Dataset array rendered in charts, grids, or tables. (Default: []) |
| weeks | number | Configures weeks. |
| height | number | Configures height. (Default: 400) |