SwipeUI

Activity heatmap

Daily calendar activity without timezone shifts or invented missing values.

npx @swipeui/cli add activity-heatmap
Variant
Preset
Material
Scheme
Feel
Interactive web demo. Native materials, gestures and system presentation differ on device.

When to use it

  • Daily calendar activity without timezone shifts or invented missing values.

When not to use it

  • Use Metric card when one headline number answers the question without a full plot.

Installation

Installs with a Pro licence

Everything on this page is public except the source. Founder pre-sale opens around 5 January 2027.

Usage

import { ActivityHeatmap } from '@/components/swipeui/chart/activity-heatmap';

<ActivityHeatmap label="Daily practice" year={2026} days={30} cellSize={34} colorMode="opacity" data={[{ date: "2026-01-01", value: 4 }]} />

Examples

habits. App and public preview use the same original scenario data. Range and feature controls stay outside the component.

Settings

PropDefaultBehaviour
tooltipPlacementplotPlace inspection inside the plot or above it.
tooltipWidth184Readout width bounded by the visible plot.
renderTooltipdefault cardCustom inspection content; streamgraph supplies a coloured multi-row comparison.
dismissOnOutsidePresstrueClear floating inspection when touching outside a chart under ChartInteractionProvider.
colorsuccess tokenBase green for opacity mode; palette mode keeps independent band colours.
palettechart tokensOptional colours in ascending intensity order.
colorModeopacitySingle hue with opacity, or palette colours per intensity band.
cellSize34Day pitch in points including its gutter; bounded 24–64.
endDateyear's last dayInclusive civil date at the end of the window.
daysfull yearNumber of days ending at endDate (1–366).
data—ISO civil dates, not UTC timestamps; missing days are unavailable.
year—Calendar year.
weekStart1Sunday or Monday starts a column.
levels[0,1,3,6]Ascending nonnegative intensity thresholds.
monthLabelstrueMonth headings.
weekLabelstrueWeekday labels.
label—Short accessible chart name.
summary—Written description of the pattern, in the caller's words.
loadingfalseShow shimmer placeholders and expose the busy state.
invalidfalseExplicitly unavailable dataset.
interactivetrueEnable plot interaction and accessible value stepping.
tooltiptrueCompact floating value card over the selected observation.
legendtrueShow a labelled series/category key.
hapticstrueTick when a different observation is selected.
revealtrueReveal geometry on first appearance.
animateDatatrueMorph data changes; resize snaps.
activetruePause ambient effects on hidden routes.
selectedId—Controlled observation ID; null clears selection.
defaultSelectedIdnullInitial observation when uncontrolled.
onSelectionChange—Called only when semantic selection changes.
locale—Device locale unless overridden.
formatValue—Override value formatting.
messages—Translatable built-in strings.
motion—Inherited SwipeUI motion feel.
height208Plot height in points; text flows outside it.
className—Root class escape hatch.
style—Root native layout escape hatch.
testID—Stable root identifier.

Accessibility

The plot exposes its name, summary and original values. Accessible value stepping and labelled keys supplement touch. Decorative marks do not repeat the readout. Reduced motion removes geometry travel.

Presentation

Swipe horizontally to explore large cells; tap or hold then scrub for the centred count/date popup. Opacity mode defaults to green, and the intensity key is centred. Memoized day geometry is batched into at most five native colour paths under one shared range reveal, replacing per-cell animation hooks. Demo ranges are 30 days, 90 days and a year.

Layout and data

Measure from the parent; let labels and keys wrap. Use stable IDs. Missing observations are gaps, not zeros. Parts of a whole and flows require nonnegative finite values. Native runtime, screen-reader, haptic and device-performance checks remain pending.

Outside dismissal

Wrap the app or chart screen in ChartInteractionProvider from @/components/swipeui/lib/chart-core. It observes native touches without taking the responder; controls keep their normal behaviour. dismissOnOutsidePress={false} retains a caller-managed selection. Browser demonstrations use pointer observation and Escape.

Behavior and gestures

  • Select a labelled observation by touch or accessible value stepping. The caller can control the selection.
  • Data changes animate independently from reveal, selection feedback and optional ambient effects.

Accessibility

  • The chart has a written summary and named values. Decorative SVG geometry is hidden from assistive technologies.
  • Value stepping, labelled legends and text readouts supplement colour. Native screen-reader runtime validation remains pending.

Motion

  • Uses the morph, select and ambient motion roles, so it follows your app's feel. Pass motion to tune this one instance.
  • Geometry transitions use the shared morph role; reduced motion swaps immediately.
  • Ambient effects pause offscreen and in the background.

Performance

  • Default intensity levels use at most five static SVG paths for all 366 day cells, one shared range reveal and a separate selected-cell outline. Calendar labels are memoized; scrolling does not rerender the field every frame. Native frame-rate confirmation remains pending.

Notes for AI

  • Use stable IDs and caller-owned data/state. Provide an accessible label and a useful written summary.
  • Use ChartCard for an interactive chart composition; keep MetricCard sparkline content decorative.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items