āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/shadcnblocks/kibo/content/components/contribution-graph ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
This component is the visualization layer only, it doesn't handle data fetching or state management.
I highly recommend using Jonathan Gruber's GitHub Contributions API to fetch your data.
Here's an example of how to fetch and cache your data:
const username = 'haydenbleasel';
const getCachedContributions = unstable_cache(
async () => {
const url = new URL(`/v4/${username}`, 'https://github-contributions-api.jogruber.de');
const response = await fetch(url);
const data = (await response.json()) as Response;
const total = data.total[new Date().getFullYear()];
return { contributions: data.contributions, total };
},
['github-contributions'],
{ revalidate: 60 * 60 * 24 },
);
Use GitHub's color scheme with data attributes:
<Preview path="contribution-graph-custom-theme" />Hide labels and footer for a compact display:
<Preview path="contribution-graph-minimal" />Add interactive tooltips to show detailed information:
<Preview path="contribution-graph-tooltip" />Adjust block size and spacing:
<Preview path="contribution-graph-size" />Customize individual blocks with className and style props:
<Preview path="contribution-graph-custom-blocks" />Create a custom footer with composable components:
<Preview path="contribution-graph-custom-footer" />ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā