GitHub Heatmap

An interactive 52-week contribution activity graph with date-fns interval calculation, theme-aware level colors, and date tooltips.

AugSepOctNovDecJanFebMarAprMayJunJulAug
less
more

Installation

GitHub Heatmap is published as a shadcn registry item. The CLI drops the file into your project, installs its dependencies, and adds any primitives it relies on.

$npx shadcn@latest add https://akoder.xyz/r/github-map.json

Install often? Register the namespace once in components.json and use the shorter form npx shadcn@latest add @akoder/github-map.

Usage

import { GitHubCalendar } from "@/components/ui/github-map";
 
const contributions = [
  { date: "2025-01-01", count: 3 },
  { date: "2025-01-02", count: 8 },
  { date: "2025-01-03", count: 0 },
  // ... 365 days of activity
];
 
export function ActivitySection() {
  return (
    <GitHubCalendar
      data={contributions}
      colors={[
        "var(--heatmap-level-0)",
        "var(--heatmap-level-1)",
        "var(--heatmap-level-2)",
        "var(--heatmap-level-3)",
        "var(--heatmap-level-4)",
      ]}
    />
  );
}

Props

PropTypeDefaultNotes
dataArray<{ date: string; count: number }>requiredArray of ISO date strings (YYYY-MM-DD) and integer contribution counts over a 12-month interval.
colorsstring[]5 CSS variables (--heatmap-level-0 through --heatmap-level-4)Array of 5 color values mapping to activity intensity levels 0 through 4+.

Notes & Features

Manual installation

Copy components/ui/github-map.tsx into your project. Ensure date-fns, motion, and the shadcn tooltip primitive are installed.

Examples

Explore different presets, palettes, and configurations.

GitHub Classic Emerald

Traditional 5-tier GitHub green heat scale.

AugSepOctNovDecJanFebMarAprMayJunJulAug
less
more

Example 1 of 4: GitHub Classic Emerald