Skip to content

Contributor List

Display all GitHub code contributors of a repository.

Preview
  • trueberryless
  • renovate[bot]
  • github-actions[bot]
  • trueberryless-org[bot]
  • autofix-ci[bot]
  • trueberryless-bot
  • JimMadge
import { ContributorList } from "astro-contributors";

Display the code contributors of a GitHub repository using the <ContributorList> component and provide a githubRepo.

import { ContributorList } from "astro-contributors";
<ContributorList githubRepo="trueberryless-org/astro-contributors" />
Preview
  • trueberryless
  • renovate[bot]
  • github-actions[bot]
  • trueberryless-org[bot]
  • autofix-ci[bot]
  • trueberryless-bot
  • JimMadge

The <ContributorList> component accepts the following props:

Type: ${string}/${string}
Default: "withastro/docs"

Define the GitHub repository to fetch contributors from in the format owner/repo.

Type: string[]
Optional

An array of GitHub usernames to ignore when fetching contributors. This feature is very useful if you have a bot account that you don’t want to display.

import { ContributorList } from "astro-contributors"
<ContributorList githubRepo="trueberryless-org/astro-contributors" ignore={["autofix-ci[bot]", "github-actions[bot]", "renovate[bot]"]} />
Preview
  • trueberryless
  • trueberryless-org[bot]
  • trueberryless-bot
  • JimMadge

Type: string
Optional

The accent color used for the avatar background and focus outlines. This can be any valid CSS color value (Hex, RGB, HSL, etc.).

If not provided, the component will first check for a global CSS variable named --avatar-focus-color, then fall back to Starlight’s --sl-color-accent, and finally default to a standard blue.

import { ContributorList } from "astro-contributors"
<ContributorList
githubRepo="trueberryless-org/astro-contributors"
focusColor="#ff5733"
/>
Preview
  • trueberryless
  • renovate[bot]
  • github-actions[bot]
  • trueberryless-org[bot]
  • autofix-ci[bot]
  • trueberryless-bot
  • JimMadge

You can notice the focus color, when you use keyboard navigation.

Type: (username: string) => string
Optional

By default, clicking on an avatar links to the contributor’s GitHub profile. You can override this behavior by passing a function to formatLink. This function receives the contributor’s GitHub username and should return the desired custom URL as a string.

For example, you can use this to link directly to their commit history in the repository instead of their profile page.

import { ContributorList } from "astro-contributors"
<ContributorList
githubRepo="trueberryless-org/astro-contributors"
formatLink={(username) => `https://github.com/trueberryless-org/astro-contributors/commits?author=${username}`}
/>
Preview
  • trueberryless
  • renovate[bot]
  • github-actions[bot]
  • trueberryless-org[bot]
  • autofix-ci[bot]
  • trueberryless-bot
  • JimMadge