Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Contribution Graph Team Block for React

A framed contribution graph of 26 weeks by seven days for a package registry, with avatar toggles to pick Everyone or one of four maintainers and a commit total that counts up once.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A contribution graph for React with Base UI, written for Gillamoor, a fictional package registry. A compact header sits over a framed figure with + marks at its corners. In the frame, a row of avatar toggles picks Everyone or one of four maintainers, and a large total of commits counts up once when the graph scrolls into view (and counts on from there when you pick someone else). Under the name is the graph itself: 26 weeks by seven days, April to September, each day one of five solid steps of the foreground, scaled to the busiest day of the picked view, with month names above and Mon, Wed and Fri beside it. The columns sweep in one after another on load; under reduced motion the graph is drawn at once and the number shows its value. On a phone the graph scrolls sideways in a labelled region. It is built from Toggle Group, Avatar, Counting Number and Guides with your theme's tokens. The commits are made up for the example.

FAQ

How do I change the maintainers and their days?

Edit MAINTAINERS at the top of the file: a name, a role, how many commits a busy day can reach (cap) and a quiet stretch of weeks. The days are made from a fixed formula, so every render, on the server and in the browser, draws the same graph and nothing is random. To use real data, replace daysOf with your own list of 182 numbers per person (26 weeks of seven days, Monday first); Everyone is the sum of the people, and the total is counted from the days.

How does the picker work with a keyboard and a screen reader?

It is a group of toggles named "Show commits by"; each avatar toggle is named for the person ("Anya Volkova") and the first is Everyone. Arrow keys move between them and one is always chosen. A polite status line reads each pick once ("Anya Volkova: 214 commits in 26 weeks, 31 in the busiest week"), so the counting number, which is hidden from assistive technology while it counts, never chatters.

What do assistive technologies get instead of the squares?

The squares are drawn and hidden from them. An unseen table in the same labelled region lists every day's commits for the picked view, one row per week and one column per day, so the data is complete without the picture.

Why does the same square look darker for one person than another?

The steps are relative: none, then four equal bands up to the picked view's busiest day, so each person's quiet and busy days read clearly whatever their pace. The legend says "Busiest day = darkest square". The real number is always in the table twin.

What moves, and what happens with reduced motion?

On load the weeks fade in one column after another, and the total counts up when the graph is on screen. Picking someone fades the squares to their new steps. With reduced motion the graph and the number appear at once and nothing transitions.

How does it fit on a phone?

Twenty-six weeks need about 620 pixels, so below that the graph scrolls sideways inside a focusable, labelled region (use the arrow keys); the day names stay put beside it. The picker scrolls sideways too if it has to, and nothing else on the page scrolls at 320 pixels. The graph is always drawn left to right, oldest week first, even in a right-to-left page.

  • Pro

    Maintainers Table Team

    Projects and workload

    A table of an open-source project's six maintainers and contributors with their repositories, a twelve-week contribution strip and a button that opens their good first issues in place under the row.

  • Pro

    Contributors Wall Team

    Projects and workload

    A wall of 24 contributors to a static-site generator in hairline cells, under a band of four totals (contributors, commits, pull requests and stars) added up from the data.

  • Pro

    A twelve-week by seven-day commit heatmap whose five-step legend is a set of toggles: choosing a level keeps only those days at full strength, outlines the rest and counts the days.

  • Pro

    A six-week calendar of square cells showing each day's date and meeting hours in five foreground steps, beside the month's total, busiest day, quietest weekdays and weekday average.

  • Pro

    One segmented share bar of a release's commits by contributor with a counted legend, over the three most recent changelog entries each credited with an avatar and name.

  • Pro

    Skill Bars Team

    Skills and expertise

    A picker of five e-learning specialists beside a framed figure of five skill bars: choosing a person fills the bars to their scores, each with its number and a tick for the team average on its track.