Skip to content

Components

GitHub card

Link to a GitHub repository with a card that shows its description, stars, and forks.

doccupine/cliGenerate beautiful, ready-to-use documentation with just one CLI command – fast, simple, and open source. AI-ready.16 stars3 forks

GitHub card usage

Pass the repository as owner/name.

html
<GitHubCard repo="doccupine/cli" />

Cards sit side by side in columns.

html
<Columns cols={2}>
  <GitHubCard repo="vercel/next.js" />
  <GitHubCard repo="facebook/react" />
</Columns>

Where the numbers come from

The description and the counts are fetched from GitHub's API while your site builds, never from the reader's browser. They are kept for a day: where your host supports refreshing static pages (Vercel does), a page with a card is rebuilt at most once a day with fresh numbers.

When GitHub cannot be reached, answers slowly (after five seconds), or refuses the request, the card still shows the repository name and links to it, without the counts, and the build carries on.

GitHub token

Without a token, GitHub allows 60 API requests an hour from one address, which a build with many cards can use up. Set a GITHUB_TOKEN environment variable to raise the limit:

bash
GITHUB_TOKEN=github_pat_...

A fine-grained token with no extra permissions is enough for public repositories. The token is only read on the server while pages build, and is never sent to readers.

Properties

repostringrequired

The repository, as owner/name. A value that is not a valid GitHub repository name shows no card, with a warning in the build log.