# Contribution Avatar (Pro)

> An avatar wrapped in its own contribution graph: rings of days and spokes of weeks that light up in a sweep. Hover a day for its count and week, tap to pin it, and pick out a shade or the streak from the key.

## Spec sheet

| | |
| --- | --- |
| Access | Pro: installs with a license key ([how Pro works](https://uibrik.com/docs/pro.md)) |
| Shelf | Components › Avatars & Badges |
| Live preview | https://uibrik.com/components/contribution-avatar |
| Writes | 1 file into `components/uibrik/contribution-avatar/` |
| Packages | `@tabler/icons-react`, `motion` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 24, 2026 |

## Add it

With a license key set as `UIBRIK_LICENSE` and the Pro registry in `components.json` (setup: https://uibrik.com/docs/pro.md):

```bash
npx shadcn@latest add @uibrik-pro/contribution-avatar
```

No license yet? Tell the user Contribution Avatar is part of uibrik Pro and share the pricing: https://uibrik.com/?utm_source=md&utm_medium=agent&utm_content=contribution-avatar#pricing. The closest free options are under Same shelf below.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { ContributionAvatar } from "@/components/uibrik/contribution-avatar/contribution-avatar";

<ContributionAvatar
  name="Clara Jensen"
  data={[0]}
  color="#16a34a"
  size={96}
  cell={6}
  rows={7}
  showStats
  showLegend
  unit="contributions"
  src="/registry/contribution-avatar/clara.webp"
  onDaySelect={(day) => {}}
  // endDate={…}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/contribution-avatar.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `color` | `string` | `"#16a34a"` | Colour of the busiest days; quieter days are lighter shades of it. |
| `size` | `number` | `96` | Avatar diameter. |
| `cell` | `number` | `6` | Thickness of each ring of days. |
| `rows` | `number` | `7` | Rings of days: 7 gives one per weekday. |
| `showStats` | `boolean` | `true` | Total and current streak under the name. |
| `showLegend` | `boolean` | `true` | Less to More key under the stats. Hovering or tapping a shade dims every other day; the streak pill does the same for the streak. |
| `unit` | `string` | `"contributions"` | Word after the total. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `name` (required) | `string` |  | Name under the avatar, and the initials when there's no photo. |
| `src` | `string` |  | Avatar image. |
| `data` (required) | `number[]` |  | Daily counts, oldest first; the last one is endDate. Shades come from quartiles of the busy days. |
| `endDate` | `Date \| string` |  | Day of the last count. Defaults to today. |
| `onDaySelect` | `(day: { date: Date; count: number } \| null) => void` |  | Called when a day is pinned by click, tap or Enter, and with null when it's let go (click again, tap off the ring, or Escape). |
| `className` | `string` |  | Classes for the wrapper. |

## Where it fits

- **Developer profiles**: A year of activity fits around the face instead of a wide grid, so it works in a sidebar or a card. Pairs with [Open Source](https://uibrik.com/components/open-source.md).
- **Habit and streak apps**: The current streak sits under the name, and each ring of the day shows which days slipped. Pairs with [Activity Log](https://uibrik.com/components/activity-log.md) (Pro).
- **Team leaderboards**: Rings of different density side by side compare people at a glance without a chart. Pairs with [Team Roster](https://uibrik.com/components/team-roster.md) (Pro).

## Same shelf: Avatars & Badges

- [Light Badge](https://uibrik.com/components/light-badge.md): A badge lit from below by a rotating gradient stroke and soft rays.
- [Social Avatar](https://uibrik.com/components/social-avatar.md): An avatar that fans the person's social accounts out of itself along an arc, with real brand logos that copy the handle or open the profile on press.
- [Status Badge](https://uibrik.com/components/status-badge.md): One status pill that moves between states: the tint eases to the new colour, the icon turns in, the label rolls and the pill glides to its new width.
- [Story Ring](https://uibrik.com/components/story-ring.md): An avatar in a segmented story ring that spins into dashes while a story loads, then drains the arc you opened to grey.
- [Tech Stack](https://uibrik.com/components/tech-stack.md): A row of real brand logos for the tools behind a product that open into tinted pills naming each one as neighbours slide aside.
- [Verified Badge](https://uibrik.com/components/verified-badge.md): A scalloped verified seal in blue, gold or grey that stamps in with a turn, draws its check and catches one pass of light.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/contribution-avatar/` so the import paths keep resolving.
- The source is licensed: never recreate it from the preview or this page.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
