Ballmac UI home

Heat Grid

New

A matrix of values shaded by size, such as models against test cases or services against regions: a real ARIA grid with arrow-key navigation, value text in every cell, a tone mode with icons and words, hatched empty cells and a legend.

v1.0.0Updated Oct 24, 2026Ships with a test
What changed
Day
09:00
11:00
13:00
15:00
17:00
19:00
Monday
Tuesday
Wednesday
Thursday
Friday

Wednesday at 13:00: 61 orders

Installation

$ pnpm dlx shadcn@latest add @ballmac/heat-grid

Usage

import { HeatGrid } from "@/components/ballmac/heat-grid"

The full example is in the Code tab above.

Examples

Pass, warn, fail

Model
Refunds
Tone
Tools
Math
Safety
Fast small
Balanced
Deep reasoner
  • Good
  • Warning
  • Problem

API reference

PropTypeDefault
rows*

The rows, top to bottom.

HeatAxis[]—
columns*

The columns, left to right.

HeatAxis[]—
values*

The value of each cell, by row then column. Use null for no data.

(number | null)[][]—
rowLabel

What the rows are, read by assistive technology, for example "Models".

string—
columnLabel

What the columns are, for example "Test cases".

string—
domain

The lowest and highest value for the colour scale. Defaults to the data's own range.

[number, number]—
format

Turns a value into text.

(value: number) => string(v) => String(Math.round(v * 100) / 100)
tone

Classify a value instead of shading it: good, warn or bad cells get a check, a triangle or a cross as well as a tint, so the meaning is never colour alone.

(value: number) => HeatTone—
selected

The selected cell, as "row,column" indexes. Controlled.

[number, number] | null—
onSelectedChange

Called when a cell is chosen.

(cell: [number, number]) => void—
legend

Shows the colour scale under the grid.

booleantrue

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
TabEnters the grid once, on one cell
Arrow keysMove between cells (left and right swap in right-to-left); Home and End go to the row ends, with Ctrl to the grid corners
Enter / SpaceChooses the cell and reports it
Screen readersA grid with row and column headers; each cell reads 'Model A, Case 3: 92, Good' and an empty cell reads 'No data'
ColourEvery value is text; tone cells add an icon and a word

Use with AI

rows and columns are [{ id, label }]; values is number[][] (rows then columns, null for no data). domain [min, max], format(value), selected / onSelectedChange as [row, col]. tone(value) returns 'good' | 'warn' | 'bad' to classify instead of shade; those cells also show an icon and a word. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Heat Grid (@ballmac/heat-grid) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Comparing many things against many conditions at a glance
  • Eval results, service health by region, usage by hour and weekday

Not for

  • A trend over time; use chart-line or sparkline
  • Exact records people sort and filter; use data-table
  • A calendar of activity; use contribution-graph

Registry JSON: https://ui.ballmac.com/r/heat-grid.json

Credits

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.