GitHub Contributions
ncdai/github-contributionsUnverifiedComponent
Visualize year-long GitHub contribution activity with daily counts, tooltips, and a profile link.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/Sumeet011/Portfolio/main/public/r/github-contributions.jsonSource
1"use client"23import { use } from "react"4import { format } from "date-fns"56import { cn } from "@/lib/utils"7import { Spinner } from "@/components/ui/spinner"8import {9 Tooltip,10 TooltipContent,11 TooltipTrigger,12} from "@/components/ui/tooltip"13import type { Activity } from "@/registry/components/contribution-graph"14import {15 ContributionGraph,16 ContributionGraphBlock,17 ContributionGraphCalendar,18 ContributionGraphFooter,19 ContributionGraphLegend,20 ContributionGraphTotalCount,21} from "@/registry/components/contribution-graph"2223export function GitHubContributions({24 contributions,25 githubProfileUrl,26 className,27}: {28 contributions: Promise<Activity[]>29 githubProfileUrl: string30 className?: string31}) {32 const data = use(contributions)3334 return (35 <ContributionGraph36 className={cn("mx-auto py-2", className)}37 data={data}38 blockSize={11}39 blockMargin={3}40 blockRadius={2}41 >42 <ContributionGraphCalendar43 className="no-scrollbar px-2"44 title="GitHub Contributions"45 >46 {({ activity, dayIndex, weekIndex }) => (47 <Tooltip>48 <TooltipTrigger asChild>49 <g>50 <ContributionGraphBlock51 activity={activity}52 dayIndex={dayIndex}53 weekIndex={weekIndex}54 />55 </g>56 </TooltipTrigger>57 <TooltipContent className="font-sans">58 <p>59 {activity.count} contribution{activity.count > 1 ? "s" : null}{" "}60 on {format(new Date(activity.date), "dd.MM.yyyy")}61 </p>62 </TooltipContent>63 </Tooltip>64 )}65 </ContributionGraphCalendar>6667 <ContributionGraphFooter className="px-2">68 <ContributionGraphTotalCount>69 {({ totalCount, year }) => (70 <div className="text-muted-foreground">71 {totalCount.toLocaleString("en")} contributions in {year} on{" "}72 <a73 className="text-foreground link-underline"74 href={githubProfileUrl}75 target="_blank"76 rel="noopener"77 >78 GitHub79 </a>80 .81 </div>82 )}83 </ContributionGraphTotalCount>8485 <ContributionGraphLegend />86 </ContributionGraphFooter>87 </ContributionGraph>88 )89}9091export function GitHubContributionsFallback() {92 return (93// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from ncdai
All 48 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Apple Hello Effectapple-hello-effect | ncdai | Components | Unverified | 1 dep | |
| Apple Hello Effect - Hindiapple-hello-effect-hindi | ncdai | Components | Unverified | 1 dep | |
| Apple Hello Effect - Spanishapple-hello-effect-spanish | ncdai | Components | Unverified | 1 dep | |
| Apple Hello Effect - Vietnameseapple-hello-effect-vietnamese | ncdai | Components | Unverified | 1 dep | |
| Brand Assets Menubrand-assets-menu | ncdai | Components | Unverified | 1 dep | |
| chevrons-up-down-iconchevrons-up-down-icon | ncdai | Components | Unverified | 1 dep | |
| Code Block Commandcode-block-command | ncdai | Components | Unverified | 4 deps · 2 files | |
| Consent Managerconsent-manager | ncdai | Components | Unverified | 1 dep |
