Docs Kickstarter

GitHub Statistics

A widget that displays GitHub statistics including stars, forks, and followers.

Example

Import

import GitHubStats from "@/components/block/GitHubStars.astro"

Usage

Stars for GitHub Repository

Stars
...
<GitHubStats 
  repo="block/goose"/>

Forks for GitHub Repository

Forks
...
<GitHubStats 
  repo="block/goose"
  type="forks"/>

Followers for GitHub Account

Followers
...
<GitHubStats 
  account="block"
  type="followers"/>

Sizes

The GitHub Stats component supports different sizes:

<GitHubStats size="lg" />
<GitHubStats size="default" />
<GitHubStats size="sm" />

Default Size

Stars
...

Large

Stars
...

Small

Stars
...

Properties

The GitHub Stats component accepts the following props:

PropTypeDefaultDescription
typestringstarsThe type of GitHub statistic to display. Accepts stars, forks, or followers.
repostringNoneRequired for stars and forks types; the repository name, e.g. “block/goose”
accountstringNoneRequired for followers type; the GitHub username or organization name, e.g. “block”
sizestringdefaultThe size of the component. Accepts default, sm, and lg