GitHub Star Counter
paceui-gsap/github-star-counterFreeComponent
Display live GitHub star count for any public repository
Live preview
live · rendered by the registry
Rendered by PaceUI GSAP on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://gsap.paceui.com/r/github-star-counter.jsonSource
1"use client";23import { useEffect, useState } from "react";45import { RollingNumber } from "@/components/gsap/rolling-number";67const fetchGitHubStars = async (repo: string): Promise<number> => {8 const res = await fetch(`https://api.github.com/repos/${repo}`);9 if (!res.ok) throw new Error("Failed to fetch repo info");1011 const data = await res.json();12 return data.stargazers_count;13};1415export const GithubStarCounter = ({16 repo = "paceui/gsap",17 defaultStar = "000",18}: {19 repo: string;20 defaultStar?: number | string;21}) => {22 const [stars, setStars] = useState<number | string>(defaultStar);2324 useEffect(() => {25 let isMounted = true;26 fetchGitHubStars(repo).then((stars) => {27 if (isMounted) setStars(stars);28 });29 return () => {30 isMounted = false;31 };32 }, [repo]);3334 return (35 <a36 className="bg-card border-foreground/5 flex items-center gap-2 rounded-full border-2 px-3 transition-all"37 href={`https://github.com/${repo}`}38 target="_blank">39 <svg viewBox="0 0 438.549 438.549" className="size-4.5">40 <path41 fill="currentColor"42// … truncated
What it pulls in
Other registry items
Files it writes
More from PaceUI GSAP
All 29 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Modal Ability Selectorai-modal-ability-selector | PaceUI GSAP | Components | Free | 2 deps | |
| Modal Selectorai-modal-selector | PaceUI GSAP | Components | Free | 2 deps | |
| Response Writerai-response-writer | PaceUI GSAP | Components | Free | 2 deps · 2 files | |
| AI Suggestionsai-suggestions | PaceUI GSAP | Components | Free | 2 deps | |
| Modal Ability Selectorai-token-counter | PaceUI GSAP | Components | Free | 2 deps | |
| Animated Stackanimated-stack | PaceUI GSAP | Components | Free | 2 deps | |
| Bouncing Textbouncing-text | PaceUI GSAP | Components | Free | 2 deps | |
| Dot Flowdot-flow | PaceUI GSAP | Components | Free | 2 deps |
