Beautiful contribution graphs for Vue 3, React, and Svelte-powered by GitHub, GitLab, and Bitbucket
- π¨ Multi-Platform - GitHub, GitLab, and Bitbucket support
- β‘ Zero Runtime API Calls - Static data via GitHub Actions
- π‘οΈ Always Works - Multi-tier fallback system (static β cache β mock)
- π± Responsive - Mobile-friendly with touch support
- π― Framework-Agnostic Core - Shared logic across all packages
- π¨ Customizable - Multiple color schemes and component slots
- π§ Type Safe - Full TypeScript support
- π§ͺ Well Tested - Comprehensive test coverage
| Package | Framework | Status |
|---|---|---|
| @git-stats-components/vue | Vue 3 | |
| @git-stats-components/react | React | |
| @git-stats-components/svelte | Svelte | |
| @git-stats-components/core | Agnostic |
npm install @git-stats-components/vue<script setup>
import { ContributionGraph, StatsBreakdown } from '@git-stats-components/vue'
import '@git-stats-components/vue/style.css'
</script>
<template>
<ContributionGraph data-url="/data/git-stats.json" />
<StatsBreakdown data-url="/data/git-stats.json" />
</template>npm install @git-stats-components/reactimport { ContributionGraph, StatsBreakdown } from '@git-stats-components/react'
import '@git-stats-components/react/style.css'
function App() {
return (
<>
<ContributionGraph dataUrl="/data/git-stats.json" />
<StatsBreakdown dataUrl="/data/git-stats.json" />
</>
)
}npm install @git-stats-components/svelte<script>
import { ContributionGraph, StatsBreakdown } from '@git-stats-components/svelte'
</script>
<ContributionGraph dataUrl="/data/git-stats.json" />
<StatsBreakdown dataUrl="/data/git-stats.json" />- GitHub Actions fetches your stats daily (or on-demand)
- Static JSON file is generated and committed to your repo
- Components load from the static file (fast & reliable)
- Fallback system ensures it always works (cache β mock data)
- β No runtime API calls - Visitors never hit rate limits
- β Fast loading - Static file loads instantly
- β Never breaks - Always has fallback data
- β Free tier friendly - One API call per day vs thousands
- β Works offline - Can develop with cached/mock data
The easiest way to get started is using the CLI tool:
# Install your framework package
npm install @git-stats-components/vue
# Initialize config and GitHub Actions
npx @git-stats-components/vue initThis creates:
git-stats.config.js- Configuration file.github/workflows/update-git-stats.yml- GitHub Actions workflowpublic/data/- Directory for stats data
Edit git-stats.config.js:
export default {
profiles: [
{
username: 'your-github-username',
platform: 'github',
tokenSecret: 'GITHUB_TOKEN'
}
],
dataPath: 'public/data/git-stats.json',
schedule: '0 2 * * *' // Daily at 2 AM UTC
}Go to Settings β Secrets and variables β Actions and add:
GITHUB_TOKEN- Your GitHub Personal Access TokenGITLAB_TOKEN- (Optional) Your GitLab access tokenBITBUCKET_TOKEN- (Optional) Your Bitbucket app password
That's it! The GitHub Action will fetch your stats daily.
Want to see it in action? Clone this repo and run:
pnpm install
pnpm build
pnpm demoThen visit http://localhost:3000
| Platform | Contribution Graph | Stats |
|---|---|---|
| GitHub | β | β |
| GitLab | β* | β |
| Bitbucket | β* | β |
*GitLab and Bitbucket APIs don't provide contribution graph data
- Node.js 18+
- pnpm 8+
git clone https://github.com/derekjj/git-stats-components.git
cd git-stats-components
pnpm install
pnpm build# Build all packages
pnpm build
# Build specific package
pnpm build:core
pnpm build:vue
pnpm build:react
pnpm build:svelte
# Development (watch mode)
pnpm dev:vue
pnpm dev:react
pnpm dev:svelte
# Run tests
pnpm testContributions are welcome! Please see our Contributing Guide.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
pnpm test - Build packages:
pnpm build - Commit:
git commit -m 'feat: add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
MIT Β© Derek Johnston
Made with β€οΈ by developers, for developers

