FORMA Docs

Activity heatmap

See a year of activity at a glance, one square per day.

import { ActivityHeatmap } from "@/forma/arc/activity-heatmap/activity-heatmap";
Base

In FORMA

  • Liegt in kit/arc/activity-heatmap und ist über @/forma/arc/activity-heatmap/activity-heatmap erreichbar.
  • Farbe, Ecken, Höhen, Abstände, Tiefe, Schrift und Tempo kommen aus der Richtung (core/arc-bridge.ts); Arc behält Verhalten, Tastatur und Federn.

When to use

  • Daily rhythm over a long range, like contributions or workouts.
  • Views where streaks and quiet weeks matter more than exact comparison.

When not to use

  • Use bar-chart when the exact comparison is the point.
  • Use calendar to pick dates.

Usage

import { useState } from "react";
import { ActivityHeatmap } from "@/forma/arc/activity-heatmap/activity-heatmap";

export function Contributions({ days }: { days: { date: string; count: number }[] }) {
  const [selected, setSelected] = useState<string | null>(null);
  return (
    <ActivityHeatmap days={days} label="Contributions in 2026" period="2026" selectedDate={selected} onSelectDate={setSelected} />
  );
}

API reference

ActivityHeatmap

A contribution style calendar with one tinted square per day and a hover or focus tooltip.

PropTypeDefaultDescription
days (required){ date: string; count: number }[]–One entry per day as YYYY-MM-DD, oldest first. Missing days count as zero.
label (required)string–Accessible name for the grid, such as "Contributions in 2025".
period (required)string–Finishes the summary: "1,284 contributions in {period}".
unit{ one: string; other: string }{ one: "contribution", other: "contributions" }Nouns for the count.
thresholds[number, number, number]–Upper bounds for levels one to three. Defaults to quarters of the busiest day.
weekStartsOn0 | 10Sunday or Monday as the first row.
selectedDatestring | nullnullDay drawn with a selection ring.
onSelectDate(date: string) => void–Called on click, Enter, or Space.
actionsReactNode–Controls beside the summary, such as a range switch.
localestring"en-US"Formatting locale.
classNamestring–Class for the root.

Keyboard interactions

KeysAction
ArrowUp / ArrowDownMoves one day back or forward.
ArrowLeft / ArrowRightMoves one week back or forward.
Home / EndJumps to the first or last day.
Enter / SpaceSelects the focused day.
EscapeHides the tooltip.

Accessibility

  • The grid is role="grid" with labelled gridcells and a hidden legend explaining the levels.
  • Legend swatches are toggle buttons with aria-pressed that highlight days of one level.
  • The total and hovered day are announced through status and polite live regions; the tooltip itself is aria-hidden.

Motion

  • Cells wave in once on view and a new range recolors the grid in a sweep.
  • The tooltip glides between cells and its text rolls; the total counts to new values.
  • Reduced motion drops the wave, sweep, and glide in favor of short fades.

Responsive behavior

  • Cells scale between 9px and 15px with the container, then the grid scrolls horizontally from the newest week.
  • Below a 440px container the caption switches to a short form.
  • On touch the tooltip lingers after a tap instead of hiding at once.

Performance

  • Every day is its own cell, so a year is about 370 elements; the reveal wave is capped in total time.
  • One shared tooltip serves the whole grid.

Notes for AI

  • Use when rhythm, streaks, and quiet weeks matter more than exact comparison. Use bar-chart when the exact comparison is the point.
  • Pass a range switch through actions and swap days to change the period.

Also in charts

  • Line chart: A multi-series line chart with a gliding crosshair, legend toggles, and paths that morph between ranges.
  • Donut chart: A donut whose arcs morph between datasets, with the active value rolling into the center.
  • Streamgraph: Layered streams on a wiggle baseline that morph between ranges, with a layer you can isolate and read week by week.
  • Brush chart: A dense time series with an overview strip: drag a window to zoom, resize it by its handles, and read events in place.
  • Waffle chart: A ten by ten unit chart where every cell is one percent, and cells fly to their new group when the data changes.
  • Slope chart: Before and after on two axes: lines draw in, rank moves sit beside each value, and switching datasets slides every line to its new slope.
  • Gauge: Show a value against a known range.
  • Animated counter: Give changing totals a clear sense of movement.
  • Ridgeline: Overlapping distributions, one ridge per group: hover to lift a ridge and read its quartiles, switch datasets and every curve morphs.
  • Treemap: A squarified treemap: click to drill and the tiles grow to fill the view, with a breadcrumb back and metrics that morph every tile.
  • Split bar: A single 100% bar split into shares: rest on a segment to widen it and read its exact figures, toggle segments from the legend and the rest reflow, with labels inside when they fit and on leader lines when they don't.

Guidance for AI tools

Activity heatmap: See a year of activity at a glance, one square per day. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://uiarc.dev/llms.txt

Komponente und Text: Arc UI (MIT, uiarc.dev), angepasst für FORMA.