Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Legend Filter Heatmap Stats Block for React

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.

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 commit heatmap with a legend you can press, for React with Base UI. A header says how many of the 84 days saw ten commits or more, "15 of 84 days saw ten commits or more". A framed grid shows twelve weeks across and Monday to Sunday down, each day one of five solid steps of your theme's foreground colour. The key beside it (under it on a phone) is the control: five toggle buttons, one per step, each with its swatch, its range of commits and how many days sit at it. Choosing steps keeps only those days at full strength and draws every other day as an empty outline, so nothing moves; choosing none shows every day. A polite line counts the result, "34 days at this level". The counts and the grid come from one seeded list of daily commits, so the server and the browser agree. An unseen table gives every day's commits. For commit activity, support tickets, sign-ups and any measure bucketed into levels.

FAQ

How do I use my own commits?

Replace commitsFrom with your own list: 84 numbers, oldest first, starting on a Monday (twelve weeks of seven days). FLOORS are the fewest commits a day needs to reach each step and RANGES are the words the key writes for them; change both together. The counts on the toggles, the headline and the status line are computed from the list.

What does choosing a level do?

It keeps the days at that level in their full shade and draws all the others as empty outlined squares. You can choose several levels at once and switch one off by pressing it again; with nothing chosen every day shows. The grid never reflows, and the line under the key says how many days are shown. Outlines are solid, not faded, so the text and the key keep their contrast.

Can I use it without a mouse?

Yes. Each level is a toggle button with a visible focus ring and an on and off state, so it works with the keyboard and with screen readers, and the line under the key is announced politely when the count changes. The group is named "Show days by commits".

Does the grid have a text version?

Yes. The drawing is an image with a summary (the total commits and the number of top-level days), and an unseen table lists the commits of every day, a row per week. The table does not change with the filter; it always carries the full data.

How does it fit on a phone?

The header comes first, then the grid with every second week number hidden so the labels never touch, then the key as five full-width toggles. The grid is 12 columns of about 20 pixels at 320. Nothing scrolls sideways.

  • Pro

    A 26-week contribution grid of daily lessons with month labels, a Less to More key and a band of three counters for the current streak, the longest streak and the active 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

    A seven-day by 24-hour matrix of tiny squares in five foreground steps, with 00, 06, 12 and 18 hour markers, an outlined busiest hour and a readout in the frame's foot.

  • Pro

    Seven rows, one per weekday, each a strip of 24 hourly squares scaled to that day's own peak, with its total and its peak hour, in cells whose lines run past their corners.

  • 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

    Four delivery-target tiles you can filter with a segmented control (All, Watch, At risk) that dims the others, each with a bar marked at its watch and at-risk thresholds and a state in a glyph and a word.