Command Palette

Search for a command to run...

GitHub/GitHub Stars

GitHub Stars

Display repository star history with area chart visualization

Open in v0
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-stars

Usage

import { GitHubStars } from "@/components/elements/github/github-stars";

export function RepoStats() {
  return <GitHubStars owner="shadcn-ui" repo="ui" />;
}

Props

PropTypeDefaultDescription
ownerstring-GitHub repository owner
repostring-GitHub repository name
daysnumber30Number of days of history to show
staticStarsnumber-Static star count (bypasses API)
staticDatanumber[]-Static chart data (bypasses API)
classNamestring-Additional CSS classes

Environment Variables

For higher API rate limits:

GITHUB_TOKEN=your_github_token

Features

  • 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