npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@raulcanodev/react-github-dots

v1.1.55

Published

React component that generates contribution/commit visualization graphs similar to GitHub contributions.

Downloads

191

Readme

✨ React GitHub Dots

Hey! 👋 This is a React component that creates the GitHub's green dots contribution graph. Perfect for spicing up your portfolio or tracking activity in a visually appealing way!

npm version license

Compatible with React Compatible with Next.js

SCR-20250105-oixx

✨ About this package

  • 📊 Beautiful GitHub-style contribution visualization
  • 🌓 Seamless light and dark mode support
  • 🎨 Make it yours with custom color schemes
  • 🔄 Real-time GitHub data at your fingertips
  • 📱 Looks great on any screen size
  • ⚡️ Smart caching for optimal performance

🚀 Getting Started

  1. Pop this into your terminal:
npm install @raulcanodev/react-github-dots
  1. Within your React app:
import ContributionGraph from '@raulcanodev/react-github-dots';

function App() {
  return (
    <ContributionGraph 
      username="your-github-username"
      token="your-github-token"
      theme="dark" // or "light"
      cacheTime="8h" // Cache data for 8 hours
    />
  );
}

For Next.js 13+ (App Router), add the client directive:

'use client';
import ContributionGraph from '@raulcanodev/react-github-dots';

export default function Page() {
  return (
    <ContributionGraph 
      username="your-github-username"
      token="your-github-token"
      theme="dark"
      cacheTime="1d"
    />
  );
}

🎛 Configuration Options

Here's what you can tweak:

| Prop | Type | Default | What it does | |------|------|---------|-------------| | username | string | required | Your GitHub username | | token | string | required | Your GitHub access token | | theme | 'light' | 'dark' | 'dark' | Pick your style | | customColorScheme | object | null | Custom colors | | loadingComponent | ReactNode | null | Custom loading state | | cacheTime | false | '2h' | '8h' | '1d' | '1d' | Control data caching duration |

🎨 Customize The Dot Colors

Want your own color scheme? Here's how:

<ContributionGraph 
  username="your-github-username"
  token="your-github-token"
  customColorScheme={{
    0: '#ebedf0', // No contributions
    1: '#ff9b9b', // 1-3 contributions
    2: '#ff4040', // 4-6 contributions
    3: '#ff0000', // 7-9 contributions
    4: '#990000'  // 10+ contributions
  }}
/>

⚡️ Cache Control

Optimize performance with smart caching:

// Disable caching - always fetch fresh data
<ContributionGraph 
  username="your-github-username"
  token="your-github-token"
  cacheTime={false}
/>

// Cache for 2 hours
<ContributionGraph 
  username="your-github-username"
  token="your-github-token"
  cacheTime="2h"
/>

// Cache for 8 hours
<ContributionGraph 
  username="your-github-username"
  token="your-github-token"
  cacheTime="8h"
/>

// Cache for 1 day (default)
<ContributionGraph 
  username="your-github-username"
  token="your-github-token"
  cacheTime="1d"
/>

🛠 Development & Contributions

Getting Set Up

  1. Grab the code:
git clone https://github.com/raulcanodev/react-github-dots.git
cd react-github-dots
  1. Install what you need:
npm install
  1. Build it:
npm run watch

🧪 Testing Locally

  1. Link your package locally, which allows you to test it in other projects:
npm link
  1. Create a new React app and link the component:
npx create-react-app test-github-dots
cd test-github-dots
npm install react react-dom
npm link @raulcanodev/react-github-dots
  1. In your App.jsx, import and use:
import ContributionGraph from '@raulcanodev/react-github-dots';

🔄 Development Flow

Want to see changes in real-time? Here's how:

  1. In your package directory:
npm run watch
  1. In your test app:
npm run dev

Need to refresh the link for any bug? Try:

npm unlink @raulcanodev/react-github-dots
npm link @raulcanodev/react-github-dots

🔑 Getting Your GitHub Token

You'll need a GitHub Personal Access Token with read:user scope. Get one here: https://github.com/settings/tokens?type=beta

📝 License

MIT © Raul Cano


Made with ❤️ by Raul Cano. Questions? Issues? Feel free to reach out!

Want to contribute? PRs are always welcome! 🙌