Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Month Contribution Heatmap Features Block for React

A 26-week contribution calendar for an engineering analytics tool, with a toggle between merges, reviews and deploys, streak figures and three highlights counted from the series on screen.

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 calendar for React with Base UI. A left-aligned header says "Six months of shipping, one calendar" and holds a three-button toggle at its end: Merged, Reviews and Deploys. A framed figure (its lines run past the corners with + marks) draws 26 weeks by 7 days of squares in five steps of foreground opacity, with month names above, Monday, Wednesday and Friday beside, and a legend under it; beside it (under it on a phone) a list of three figures gives the current streak, the longest streak and the active days. Three highlights below, each in a cell with overshooting lines, give the first 13 weeks, the last 13 and the busiest week. Pressing a toggle button redraws everything from that series: the squares, the streaks and the totals, with the digits rolling to their new values. It's built from Guides, Toggle Group and Sliding Number, with CSS for everything else.

FAQ

How do I use my own activity?

Replace the three entries of SPECS: each one names a series (label, noun) and shapes its days (seed, busiest, idle, weekend, lull). The days are drawn by a small number generator from the seed, so the calendar is the same on the server and in the browser. To use real data, return your own array of 179 daily counts from daysOf (26 weeks, the last one ending on a Thursday, or change LAST_DAY); every other figure is counted from it.

How are the streaks counted?

A streak is a run of days with any work. A quiet Saturday or Sunday doesn't break it, a quiet weekday does. The current streak is the run that ends on the last day of the calendar, and the longest is the best run in the 26 weeks. They are counted by streaksOf, so they always agree with the squares.

How are the five steps chosen?

A day's step is its share of the busiest day in that series: none is its own step, then four equal quarters. The steps are the foreground colour at rising opacity, so the calendar reads in any theme, light or dark, and the legend uses the same classes.

How is the calendar made accessible?

The squares are decoration, so the calendar is one image whose label is a summary: the total, the active days, both streaks and the busiest week. A table of the months' totals is there for screen readers, and a polite status line repeats the summary when you press a toggle button. The three highlights are real headings and sentences.

How does it fit on a phone?

The 26 columns share the width, so the squares shrink to about 10 pixels, the weekday labels are dropped and the month names show every third month. The three figures sit side by side under the calendar and the highlights stack, one per row. Nothing scrolls sideways at 320 pixels.

What happens in a right-to-left layout?

The calendar stays left to right in every language, because time does: the earliest week is at the start in an English page and so it is in an Arabic one. The header, the toggle, the figures and the highlights follow the page's direction, and the numbers are wrapped so they don't reorder.

  • Pro

    A 24 by 12 traffic density grid in a framed figure with a legend, three numbered callout cells, and the callouts described beside it, for a traffic observability tool.

  • Pro

    Metric Hero Strip Features

    Metrics and charts

    Four metric-over-feature columns for a data-pipeline tool: a giant tabular figure and label, then the feature that makes it true, in one divided band under a centred header.

  • Pro

    A job-queue dashboard drawn as a window in a hairline frame: a range control in its title bar re-draws the throughput line and re-reads the uptime and outcome figures, beside a seven-bar week.

  • Pro

    A split for a platform SLA monitor: copy, four ticks and a button at the start, and at the end one chart of three concentric rings with a legend, whose values a 7, 30 or 90 day toggle swaps.

  • Pro

    Changelog Features

    Timelines and steps

    A release feed for a changelog tool that presents its features as release entries: a New, Improved and Fixed filter with counts, a version rail, and a collapsible What changed list on each.

  • Pro

    A reverse split hero for a code host: a commit history drawn as a branch graph in a hairline frame on the start side, then an announcement link, the headline, a Shine Button and three ticks.