# Contributor Grid

An even mosaic of contributor faces where pointing at, focusing or tapping one slides a card over it with their commit count, rank and a weekly heat strip, while the other faces dim.

- Page and source: https://uibrik.com/components/contributor-grid
- Install (Pro, needs a license key, see https://uibrik.com/docs/pro): `npx shadcn@latest add @uibrik-pro/contributor-grid`
- Packages: none beyond React
- Import: `import { ContributorGrid } from "@/components/uibrik/contributor-grid/contributor-grid"`

Where to use the Contributor Grid React component:

- **Open source homepages**: Every contributor's face in one grid, with their commits a hover away, shows a project is more than one maintainer. Pairs with [Open Source](https://uibrik.com/components/open-source).
- **Team activity pages**: A heat strip of recent weeks per person makes who is shipping right now easy to read at a glance.
- **Community credits**: A +N tile links to the full list, so a page can thank hundreds of people without a wall of names. Pairs with [Avatar Stack](https://uibrik.com/components/avatar-stack).

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| title | `string` | `"Contributors"` | Heading above the grid. Empty hides the heading row. |
| contributorCount | `number` | `186` | Total contributors, shown by the heading; faces beyond the grid are counted in a +N tile. |
| max | `number` | `0` | Most faces in the grid. 0 shows everyone given. |
| weeks | `number` | `26` | Weeks of activity in the heat strip. |
| size | `number` | `44` | Face size. Keep it at 40 or more for touch. |
| gap | `number` | `10` | Space between faces. |
| shape | `"circle" \| "rounded"` | `"circle"` | Shape of the faces. |
| accent | `string` | `"#16a34a"` | Colour of the heat strip and the focus ring. |
| dim | `boolean` | `true` | Dim the other faces while one is open. |
| openDelay | `number` | `120` | Wait before the first card opens on hover. Moving between faces after that is instant. |
| contributors | `{ id?: string; name: string; handle?: string; src?: string; commits: number; activity?: number[]; href?: string }[]` | `SAMPLE_CONTRIBUTORS` | Faces in order. activity is commits per week, oldest first. Initials stand in when there is no photo, and href turns the name in the card into a link. |
| moreHref | `string` |  | Link for the +N tile, e.g. your full contributors page. |
| locale | `string` | `"en-US"` | Locale for number formatting. |
| active / defaultActive | `string \| null` | `null` | Id of the open card, controlled or uncontrolled. Ids default to the handle, then the name. |
| onActiveChange | `(id: string \| null) => void` |  | Called when a card opens or closes. |
| className | `string` |  | Classes for the wrapper. |
