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:
Prop | Type | Default | Description |
---|---|---|---|
type | string | stars | The type of GitHub statistic to display. Accepts stars , forks , or followers . |
repo | string | None | Required for stars and forks types; the repository name, e.g. “block/goose” |
account | string | None | Required for followers type; the GitHub username or organization name, e.g. “block” |
size | string | default | The size of the component. Accepts default , sm , and lg |