Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Heatmap Density Grid Features Block for React

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.

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 traffic density grid for React with Base UI. A left-aligned header says "See when your traffic really moves". A framed figure (its lines run past the corners with + marks) holds a grid of 24 hour rows by 12 day columns, each cell one hour drawn in one of five steps of foreground opacity, with weekday letters across the top, hour labels down the side and a legend band at its foot. Three cells are outlined and numbered, and three callouts beside the figure (under it on a phone) describe them: the busiest hour, a spike in the night and a dip in the afternoon. Every number, in the cells, the callouts and the summary, is counted from one table of hourly requests. It's built from Guides and plain CSS, with a transition for the entrance. For observability, analytics and infrastructure products.

FAQ

How do I use my own traffic?

Replace BY_HOUR (a weekday's requests per hour, in thousands), DAY_SHIFT, SPIKE and DIP with a table of your own: GRID holds one value per hour and day, and everything else is derived from it, including the five steps, the busiest cell and the text of the callouts. To point a callout at a different cell, change the day and hour it reads.

How are the five steps chosen?

Each cell's step comes from its share of the busiest hour: under 10%, 30%, 55% and 80%, then above. They are the foreground colour at rising opacity, so the grid is readable in any theme, light or dark, and the legend uses the same classes.

How is the grid made accessible?

The 288 cells are decoration, so the grid is a single image with a summary that gives its shape and what stands out. The three callouts are real headings and sentences outside the image, and they are the content a screen reader walks through. The numbered markers in the grid are decoration; each callout carries its own number.

Is this the Heatmap shader?

No. The Heatmap shader is a WebGPU effect; this is a static grid of CSS cells, with no canvas and no motion.

How does it fit on a phone?

The grid keeps all 12 columns, with shorter cells and hour labels every six rows instead of every three; weekday letters stay above. The callouts stack under the figure, each in its own cell. Nothing scrolls sideways at 320 pixels.

What happens in a right-to-left layout?

The grid stays left to right in every language, because time does: the day columns and hour labels keep their order. The header, the legend and the callouts follow the page's direction, and the numbers and times inside them are wrapped so they don't reorder.

  • Pro

    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.

  • 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 shipping-ops console drawn in greyscale with six numbered pins that open a popover on click, tap or Enter, and a legend of six rows in shared hairlines that opens the same popovers.

  • Pro

    A security-posture scanner: eight checks in a hairline grid with a beam that sweeps across it, a Pause scan toggle, and the chosen check's finding, fix and last scan in a band under it.

  • Pro

    Gauge Cluster Features

    Metrics and charts

    Three semicircle gauges in one framed band, driven by a single "Simulate load" slider: CPU, memory and queue wait, each with a needle, an arc, a reading and a state.

  • Pro

    Dashboard Preview Hero

    Product windows

    A showcase hero with a headline, a Shine Button, an outline button and a trust line above a wide browser window in a hairline frame, a greyscale sketch of an analytics dashboard that runs on below the fold.