104.7KGitHub Stars for shadcn-ui/uiLast 30 days
Overview
A full-stack component that fetches the star count and star history for a GitHub repository and displays it with an area chart visualization.
Installation
bunx shadcn@latest add @elements/github-starsUsage
import { GitHubStars } from "@/components/elements/github/github-stars";
export function RepoStats() {
return <GitHubStars owner="shadcn-ui" repo="ui" />;
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
owner | string | - | GitHub repository owner |
repo | string | - | GitHub repository name |
days | number | 30 | Number of days of history to show |
staticStars | number | - | Static star count (bypasses API) |
staticData | number[] | - | Static chart data (bypasses API) |
className | string | - | Additional CSS classes |
Environment Variables
For higher API rate limits:
GITHUB_TOKEN=your_github_tokenFeatures
- Fetches real-time star count from GitHub API
- Shows star history over configurable time period
- Self-contained with inline area chart visualization
- Built-in loading and error states
- Handles API rate limiting gracefully