GitHub Graph
unlumen-ui/github-graphFreeComponent
A polished, animated GitHub contribution graph for portfolio sites.
Live preview
live · rendered by the registry
Rendered by Unlumen Ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.unlumen.com/r/github-graph.jsonSource
1"use client";23import * as React from "react";4import { AnimatePresence, motion, useReducedMotion } from "motion/react";56import { cn } from "@/lib/utils";78export type GithubGraphVariant = "github" | "graphite" | "ocean" | "violet";9export type GithubGraphAnimation = "wave" | "scan" | "cascade";10export type GithubGraphAmbientEffect = "none" | "tide" | "drift" | "twinkle";1112export type GithubContribution = {13 date: string;14 count: number;15 level?: number;16};1718export type GithubContributionCell = GithubContribution & {19 level: number;20};2122export type GithubContributionWeek = GithubContributionCell[];2324export interface GithubGraphProps {25 /** GitHub username, with or without a leading @. @default "shadcn" */26 account?: string;27 /** Number of recent calendar months to display. @default 6 */28 months?: number;29 /** Color treatment for contribution levels. @default "github" */30 variant?: GithubGraphVariant;31 /** Entrance choreography for graph cells. @default "wave" */32 animation?: GithubGraphAnimation;33 /** Animation multiplier; higher values reveal the graph faster. @default 1 */34 animationSpeed?: number;35 /** Size of each contribution cell in pixels. @default 18 */36 cellSize?: number;37 /** Space between contribution cells in pixels. @default 4 */38 cellGap?: number;39 /** Corner radius of contribution cells in pixels. @default 3 */40 cellRadius?: number;41 /** Shows the contribution-level legend. @default false */42 showLegend?: boolean;43 /** Shows the account name above the graph. @default true */44 showAccount?: boolean;45 /** Persistent, subtle motion pattern applied to graph cells. @default "twinkle" */46 ambientEffect?: GithubGraphAmbientEffect;47 /** Strength of the persistent cell motion. @default 0.65 */48 ambientIntensity?: number;49 /** Optional preloaded contributions, which bypass the public fetch. */50 data?: GithubContribution[];51 className?: string;52}5354type ResourceState =55 | { status: "loading" }56 | { status: "ready"; contributions: GithubContribution[] }57 | { status: "error"; message: string };5859const CONTRIBUTIONS_ENDPOINT =60 "https://github-contributions-api.jogruber.de/v4";6162const VARIANTS: Record<63 GithubGraphVariant,64 [string, string, string, string, string]65> = {66 github: ["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"],67 graphite: ["#eeeeee", "#cccccc", "#969696", "#5f5f5f", "#171717"],68 ocean: ["#e6f5ff", "#b4e2ff", "#62bdf5", "#2585d8", "#124e93"],69// … truncated
What it pulls in
npm packages
Files it writes
More from Unlumen Ui
All 225 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| AI Chatai-chat | Unlumen Ui | Components | Paid | 2 deps | |
| Vercel Animate Countanimate-count | Unlumen Ui | Components | Free | 1 dep | |
| Animate Digitsanimate-digits | Unlumen Ui | Components | Free | 1 dep | |
| Animate Text Input Typinganimate-text-input-typing | Unlumen Ui | Components | Free | 1 dep | |
| Animated Listanimated-list | Unlumen Ui | Components | Free | 1 dep | |
| Apple Switchapple-switch | Unlumen Ui | Components | Free | 1 dep | |
| Aurora Barsaurora-bars | Unlumen Ui | Components | Free | 1 dep | |
| Aurora Bluraurora-blur | Unlumen Ui | Components | Free | 2 deps |
