Updated
Contribution Avatar
ProCustomize
Color
Size96px
Cell6.0px
Rings7
Weeks26
Installation
ProContribution Avatar is a Pro component
Sign in to see the source, or install it with a license key. The live preview and props above are free to explore.
Install with a key
- Add the Pro registry to
components.json:components.json { "registries": { "@uibrik-pro": { "url": "https://uibrik.com/r/pro/{name}.json", "headers": { "Authorization": "Bearer ${UIBRIK_LICENSE}" } } } } - Put your key in
.env.localand add that file to.gitignore:.env.local UIBRIK_LICENSE=your-license-key - Install it:
Terminal npx shadcn@latest add @uibrik-pro/contribution-avatar
Loading your installation…
Usage
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={…}/>Where to use Contribution Avatar
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
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
Team leaderboards
Rings of different density side by side compare people at a glance without a chart.
Pairs with Team Roster
Props
ContributionAvatar- color
- Type string
- "#16a34a"
- Colour of the busiest days; quieter days are lighter shades of it.
- size
- Type number
- 96
- Avatar diameter.
- cell
- Type number
- 6
- Thickness of each ring of days.
- rows
- Type number
- 7
- Rings of days: 7 gives one per weekday.
- showStats
- Type boolean
- true
- Total and current streak under the name.
- showLegend
- Type 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
- Type string
- "contributions"
- Word after the total.
- namerequired
- Type string
- –
- Name under the avatar, and the initials when there's no photo.
- src
- Type string
- –
- Avatar image.
- datarequired
- Type number[]
- –
- Daily counts, oldest first; the last one is endDate. Shades come from quartiles of the busy days.
- endDate
- Type Date | string
- –
- Day of the last count. Defaults to today.
- onDaySelect
- Type (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
- Type string
- –
- Classes for the wrapper.