Activity heatmap
A React component in Beamline's Charts & data-vis category.
A calendar of daily counts, one cell per day on a sequential ramp: weeks across, weekdays down, month and weekday labels, a legend scale, hatched days that were never recorded, and a keyboard grid that reads each day's date and value.
Use it for
- Daily activity over weeks or months where rhythm, streaks and quiet days matter: deploys, active users, incidents, commits.
Not for
- Comparing exact amounts between a few days (bar-chart).
- Up/down status per day or check (tracker).
- A trend line of one daily metric (line-chart).
Anatomy
- title and description (figcaption)
- table button
- month labels (above the week columns)
- weekday labels (Mon, Wed, Fri; pinned while the grid scrolls)
- grid (rows = weekdays, columns = weeks)
- day cell
- readout (focused or hovered day, else the period summary)
- legend scale (level swatches with their ranges, hatched “Not recorded” key)
Variants
- 0: ramp: accent (fades into the surface at zero, both themes) · heat · cool (the system's data ramps)
- 1: weekStartsOn: 0 (Sunday) · 1 (Monday)
- 2: thresholds: explicit level bounds, or quarters of the busiest day
States
- loading (skeleton)
- empty (no days in the range)
- unmeasured days (absent from data or null): hatched, read “Not recorded”, never zero
- measured zero: the faint zero swatch
- focused / hovered day (ring; readout shows its date and value)
- selected day (ink ring that stands out on every ramp colour, aria-selected)
- table view (every day with its value)
- narrow widths: the grid scrolls inside its frame, opened at the latest week
- right-to-left: weeks run from the right, ← and → swap, the scroller opens at the latest week on the left
Keyboard
- View as table exposes a named scroll region: Tab reaches it and Page Up / Page Down scroll its values in every supported browser
- Tab enters the grid on the selected day (or the latest one); one cell is in the tab order
- ↑/↓ move a day, ←/→ move a week (mirrored in right-to-left)
- Home/End go to the first/last day of the range; Page Up/Page Down move a month
- Enter or Space selects the day (onSelectedChange); Escape clears the selection
- Each cell's accessible name is its full date and value
Motion
Columns fade in once from the oldest week (one character stagger step every two weeks, about 300 ms for a year); instant under reduced motion. The ring that follows the day being read and the ring of the chosen day travel from day to day (--pui-duration-fast), appearing in place the first time.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
data | ActivityDay[] | — | Days in any order. Days inside the range that are missing here, or null, are unmeasured (hatched). |
start / end | string | — | start: First and last day shown (ISO dates); the data's first and last day by default. end: Last ISO date included in the grid; defaults to the latest supplied data date. |
format | (value: number) => string | — | How a day's value reads: "12 deploys". |
valueLabel | string | — | The value column's heading in the table view. Default "Value". |
thresholds | number[] | — | Lower bounds of levels 2…n (level 1 starts above zero). Default: quarters of the busiest day. |
ramp | "accent" | "heat" | "cool" | — | accent fades into the surface at zero in both themes; heat and cool are the system's data ramps; ink runs the look's ink from faint to full, for counts that aren't a series (training days). |
weekStartsOn | 0 | 1 | — | First row: 0 Sunday, 1 Monday. Default 1. |
selected / defaultSelected / onSelectedChange | string | null | — | selected: The chosen day (ISO date). defaultSelected: Initial selected ISO date when uncontrolled; defaults to null. onSelectedChange: Reports selected ids after a change; no callback by default. |
locale | string | — | Month and weekday names. Defaults to UIRoot locale. |
title / hideTitle / description | string / boolean / ReactNode | — | title: Heading shown above the content. Required. hideTitle: Hides the title; defaults to false. Deprecated: Use showTitle={false} instead. description: Supporting text beneath the label or heading. Defaults to no supporting text. |
table | boolean | — | Offers a table view of the same chart data. Defaults to true. |
loading | boolean | — | Shows the loading state while data or an operation is pending. Defaults to false. |
actions | ReactNode | — | Actions displayed with the heading or toolbar. Defaults to no actions. |
className | string | — | Classes on the documented visual root; no override by default. |
classNames | ChartClassNames | — | Classes for the named visual parts; no overrides by default. |
style / ref | CSSProperties / Ref<HTMLElement> | — | style: Inline styles on the documented visual root; no overrides by default. ref: Receives the documented native target or imperative handle; omitted by default. |
emptyLabel | string | — | What an empty chart says, in the product's own words ("No deploys yet"). Default: "No data for this range" on a chart over time, "No data yet" on the others. |
title (required) | string | — | Heading shown above the content. Required. |
showTitle | boolean | — | Shows the title visually while keeping its accessible name; defaults to true. Takes precedence over hideTitle. |
hideTitle | boolean | — | Hides the title; defaults to false. Deprecated: Use showTitle={false} instead. |
description | ReactNode | — | Supporting text beneath the label or heading. Defaults to no supporting text. |
start | string | — | First and last day shown (ISO dates); the data's first and last day by default. |
end | string | — | Last ISO date included in the grid; defaults to the latest supplied data date. |
selected | string | null | — | The chosen day (ISO date). |
defaultSelected | string | null | — | Initial selected ISO date when uncontrolled; defaults to null. |
onSelectedChange | ((date: string | null) => void) | — | Reports selected ids after a change; no callback by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no overrides by default. |
ref | Ref<HTMLElement> | — | Receives the documented native target or imperative handle; omitted by default. |
Built from
- Button
- Checkbox
- Chip group
- Dropdown menu
- Empty state
- Glow
- Kbd
- Label
- Pagination
- Search field
- Select
- Skeleton
- Spinner
- Table
- Tooltip
Used in
Dependencies
motion
Import
import { ActivityHeatmap } from "@beamline/activity-heatmap";
Get it
Activity heatmap is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent
More in Charts & data-vis
- Sankey chart: Flows between stages as bands whose width is the amount: sources to pages to outcomes, budgets to teams; hovering or focusing a node lights its flows and…
- Geo map: Values by country as a choropleth on the system's own world outline (no map service): classes from a sequential or diverging ramp with a legend you can…
- Streamgraph: Stacked flows over time around a centre baseline, with silhouette, wiggle, expand (shares) and zero offsets: a legend that turns layers on and off, a…
- Ridgeline: Distributions per group as overlapping density ridges (response time by region, order size by plan): an overlap control, median and p95 readouts per row…
- Treemap: Nested rectangles sized by value (spend by team, then service), squarified so tiles stay close to square: labels that fit or hide, hover and focus…
- Gantt chart: A plan as bars on a timeline: tasks grouped down the side, each bar from its start to its end with its progress, milestones as diamonds, arrows from each…
- Gauge: One value against a known range: a semicircle, a 270° dial or a full ring, filled or with a needle, coloured bands with their names (healthy, busy…
- Radial chart: Progress of a few measures toward their targets as concentric rings, full or half circle, with a centre readout and a list of each ring's value, target…
- Radar chart: A few series compared across the same five to eight dimensions as polygons on a polygon or circle grid; hover or arrow keys pick a dimension and read…
- Scatter chart: Two measures of many items against each other, one point per item, or a bubble chart when a third measure sizes the points: groups by colour and shape…
- Area chart: Amounts over time as filled areas: overlapping, stacked or as shares of 100%, five fills, two strokes, five curves, a range handle; gaps for missing…
- Composed chart: Different measures on one time axis: bars, lines and areas per series, a left and a right value axis with their own formats, and reference lines.
- Funnel chart: People or deals moving through ordered steps, each step a bar narrowing from the first: the part lost between two steps stays beside the next as a fading…
- Waffle chart: Units of a whole as a grid of cells by category (seats used of a plan, tickets by channel): a 10×10 grid by default, hatched cells for units whose…
- Slope chart: Change between two points in time per item, by value or by rank: labels on both sides that never collide, rising and falling told by the end marker (▲ ▼)…
- Line chart: Values over time as lines: curves, point markers, dashed series for forecasts, reference lines for limits and targets, an optional zero baseline and a…
- Bar chart: Amounts by category as bars: columns or rows, grouped, stacked or as shares, reference lines, five looks (rounded, cells, trace, isometric, monospace), a…
- Pie chart: A few shares of a whole as a pie or donut, with spaced slices, percent labels, a centre readout and a list of every slice with value and share; hovering…
- Sparkline: A compact trend beside its value: point along it or focus it and use ← → to read each point; nulls are gaps. TrendLine is the bare line.