Skip to content
Alea0.1
Pro
  1. Alea
  2. Components
  3. Charts
  4. CalendarHeatmap

ChartsAlea Pro

CalendarHeatmap

Activity per day across a year, like a contribution graph: streaks and quiet weeks at a glance.

import { CalendarHeatmap } from '@alea/pro';

Examples

Contributions

Activity per day; the darker, the more. Arrow keys move day by day.

Commits in the last year

Steady on weekdays, quiet in August.

Tokens

The design tokens this component reads, with their value in the current theme. Override any of them to restyle it.

Color

  • --alea-focus…
  • --alea-surface-raised…
  • --alea-text…
  • --alea-text-muted…

Space

  • --alea-space-1…
  • --alea-space-2…

Motion

  • --alea-motion-duration-base…
  • --alea-motion-ease-out…

Component

  • --alea-chart-1…

Props

CalendarHeatmap props

Activity per day across months, as a contribution graph: streaks and quiet weeks at a glance.

PropTypeDefaultDescription
datarequired{ date: DateValue; value: number; }[]-One value per day.
classNamestring-Extra class names for the root element.
descriptionReactNode-One sentence on what the data shows; read before the chart.
isLoadingboolean-Shows a shimmering placeholder while data loads.
showTablebooleantrueShows the table toggle. Default true.
startDateValue-First day shown. Default 52 weeks before the last date.
titleReactNode-The title shown above it and read by screen readers.
valueFormat((v: number) => string)-Formats values (axis, tooltip, table).

Specs

Generated from the source: the variants in the types, the states and tokens in the CSS, and the motion patterns that apply. The grids render the real component in both themes; the numbers are measured from the page.

States
Keyboard focusPressed (CSS)
Dark and light
Every color comes from theme tokens, so it follows data-theme (and presets like Graphite) on the page or any wrapper. Contrast is checked in both themes.
Styling hooks
.alea-calheat.alea-calheat-months.alea-calheat-body.alea-calheat-wd.alea-calheat-grid.alea-calheat-day
Data attributes
data-level=1data-level=2data-level=3data-level=4

Accessibility

  • The chart is a figure named by its title and described by its description; the picture has a text summary.
  • Tab to the chart, then arrow keys move through the data and each value is announced; Escape leaves.
  • The table toggle shows the same data as a real table for everyone who can't use the picture.

Keyboard

KeyDoes
TabFocuses the chart
Left or Right arrowPrevious or next value
Home or EndFirst or last value
EscapeClears the selection

Do and don't

Do

  • Use it for activity per day over months or a year.
  • Say in the description what a darker cell means.

Don't

  • Don't use it for exact values: use the table or a line chart.
Tested with axe, keyboard and screen reader roles