Contributor List
Display all GitHub code contributors of a repository.
Import
Section titled “Import”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" />{% contributorlist githubRepo="trueberryless-org/astro-contributors" /%}<ContributorList> Props
Section titled “<ContributorList> Props”The <ContributorList> component accepts the following props:
githubRepo
Section titled “githubRepo”Type: ${string}/${string}
Default: "withastro/docs"
Define the GitHub repository to fetch contributors from in the format owner/repo.
ignore
Section titled “ignore”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]"]} />focusColor
Section titled “focusColor”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"/>You can notice the focus color, when you use keyboard navigation.
formatLink
Section titled “formatLink”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}`}/>