A calendar component for displaying GitHub activity
npm install astro-github-activityA reusable Astro component to display interactive GitHub activity -
contributions calendars. Perfect for showing contributions or activity heatmaps
in your Astro project.
This component uses
github-contributions-api
to fetch GitHub activity data.
---
Install via npm:
``bash`
npm install astro-github-activity
`astro
---
import GithubActivity from "astro-github-activity"
// Example: pass GitHub username to fetch contributions
const username = "your-github-username"
---
``
| Prop | Type | Default | Description |
| ------------ | ----------------------------- | ------------------------------------- | ------------------------------------------ |
| username | string | - | GitHub username to fetch contributions for |
| locale | string | 'en' | Locale for formatting dates and activity |
| theme | 'light' \| 'dark' \| 'indigo' | 'indigo' | Theme for the calendar UI |
| hoverMessage | string | '{{count}} contributions on {{date}}' | Message to display on hover |
| totalMessage | string | '{{total}} total contributions' | Message to display for total contributions |
| cache | boolean | true | Enable caching for API requests |
| themeProps | object | - | Additional props for the calendar theme |
This is an example of use in my portfolio
`astro
---
import GithubActivity from "astro-github-activity"
---
`
If you want to contribute or test locally:
`bashClone the repo
git clone https://github.com/zincognity/astro-github-activity.git