Componentcharts1.22 KB gzipZero dependencies

Calendar Heatmap

GitHub-style Git calendar heatmap grid

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add calendar-heatmap

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { CalendarHeatmap } from "@/components/ui/calendar-heatmap"; <CalendarHeatmap data={data} weeks={8} />

Source code

calendar-heatmap.tsx + 1 helper

Zero 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 />
PropTypeDescription
dataCalendarHeatmapEntry[]Dataset array rendered in charts, grids, or tables. (Default: [])
weeksnumberConfigures weeks.
heightnumberConfigures height. (Default: 400)