Logo
Green Dots
Green Dots - GitHub-style contribution graphs for your React projects | Product Hunt
πŸŽ‰ Just launched: v1.1 is here

GitHub contribution graphs for React

Showcase your coding journey with stunning contribution graphs. The way to visualize your GitHub activity and make your portfolio stand out.

npm i @raulcanodev/react-github-dots
Star on GitHub

Live preview of the contribution graph component using real GitHub data.

Quick Start

Installation

npm install @raulcanodev/react-github-dots

Usage

import ContributionGraph from '@raulcanodev/react-github-dots'

export default function Example() {
  return (
    <ContributionGraph 
      username="githubusername"
      token=process.env.NEXT_PUBLIC_GITHUB_PERSONAL_ACCESS_TOKEN
    />
  )
}

Getting a GitHub Personal Access Token

  1. Go to GitHub Settings β†’ Developer Settings β†’ Personal Access Tokens β†’ Fine-grained personal access tokens
  2. Click "Generate new token"
  3. Give your token a name and select the following scopes:
    • read:user
    • repo
  4. Click "Generate token" and copy your new token
  5. Create a .env.local or .env file in your project root and add:
    NEXT_PUBLIC_GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here

Component Props

PropTypeDefaultDescription
usernamestringrequiredYour GitHub username
tokenstringrequiredGitHub personal access token
theme'light' | 'dark''dark'Color theme of the graph
customColorSchemeobjectnullCustom colors for contribution levels (0-4)
cacheTimefalse | '2h' | '8h' | '1d''1d'Duration to cache the GitHub data
loadingComponentReactNodenullCustom loading state component