Activity heat mapPro
A year of activity as week columns in five levels, with a day tooltip, year navigation and a compact strip for overview cards.
oxyn add activity-heatmapThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- A year of activity as week columns, Sunday rows first (heat_year, with jan1_weekday and month_cols for the labels).
- Five levels split at the quartiles of the non-zero days (heat_levels), so one busy day never washes the year out.
- Hovering a day, or arrowing through the grid, shows a tooltip (heat_tip: "5 chats · Mon, Oct 5").
- With more than one year the header steps with ‹ › and the total rolls; the cells fade in column by column. weeks gives the compact strip of the last weeks used in overview cards.
When not to use
- A launch countdown with digits that roll per unit, a compact one-line variant, hours absorbing days when days are hidden, and a live state with a pulsing dot at zero: use Countdown instead.
- A total that moves clearly: use Animated counter instead.
- A collapsible JSON tree with search, paging for long arrays, copy value or path, the current path under the tree and full keyboard moves: use JSON viewer instead.
Installation
Activity heat map is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add activity-heatmapUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Year
A year with ‹ › navigation and a day tooltip.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Compact
The last 24 weeks for an overview card.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
ActivityHeatmap
| Prop | Type | Default | Description |
|---|---|---|---|
yearsrequired | Vec<(i32, Vec<u32>)> | — | `(year, counts per day of the year)`, oldest first. |
title | String | Default::default() | Card title ("Threadbear activity"). |
noun | String | "chat" | Singular noun for counts ("thread"). |
verb | String | "started" | Verb after the total ("started"). |
footnote | Option<String> | Default::default() | Footnote under the grid. |
weeks | Option<u32> | Default::default() | Compact strip of the last `weeks` weeks (no labels, no year nav). |
cell | f32 | 11.0 | Cell size in px. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| ←or→ | A week back / forward |
| ↑or↓ | A day back / forward |
| HomeorEnd | First / last day |
| Esc | Hide the tooltip |
Accessibility
- The grid is one focusable element with a summary label; the tooltip is role=status so arrowing reads each day.
- Levels step in lightness and the legend reads Less → More.
- Reduced motion drops the cell fade.
From the spec
- The grid is one focusable element with a summary label; the tooltip is role=status.
- Year buttons are labelled and disabled at the ends.
Motion & interaction
Timing
- Cell fade 350 ms, delayed 9 ms a column.
- Tooltip fades in over 120 ms.
- Reduced motion: no fade or roll.
Responsive behaviour
- Scrolls sideways inside its card below the year's width.
Edge cases (spec)
- Scrolls sideways in its card below the year's width; the compact strip scales to the card.
Notes for AI
- Import
ActivityHeatmapfromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
ActivityHeatmapElinoxyn_gpui. - Props to set first:
years. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.