Display GitHub repo star count with formatted numbers and full-count tooltip.
Features
- Displays the star count of a specified GitHub repository.
- Optical alignment for better visual balance with the GitHub icon.
- Formats large numbers for better readability (e.g., 1.2k for 1200).
- Includes a tooltip that shows the full star count on hover.
Installation
pnpm dlx shadcn@latest add @syedmoin/github-stars
Usage
import { GithubStars } from "@/components/github-stars"<GithubStars repo="SyedMoin-lab/syedmoin-v10" stargazersCount={1800} />API Reference
GitHubStars
Prop
Type
Examples
Fetching GitHub Stars with Server Component
import { SOURCE_CODE_GITHUB_REPO } from "@/config/site"
import { GitHubStars } from "@/components/github-stars"
export function NavItemGitHub() {
return <GitHubStars repo={SOURCE_CODE_GITHUB_REPO} stargazersCount={900} />
}