Kinetik UI

Heat Grid

.md

A calendar grid of days shaded by activity; the cells pop in as a wave and a drag reads any day.

v1.0.0Live on web@shopify/react-native-skiareact-native-gesture-handlerreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add heat-grid

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/heat-grid.json

Install manually

  1. Install dependencies
    npx expo install @shopify/react-native-skia react-native-gesture-handler react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/heat-grid.tsx
    View source files

Usage

import { HeatGrid } from '@/components/kinetik/heat-grid';

<HeatGrid
  accessibilityLabel="Rides, last 20 weeks"
  data={ridesPerDay}
  describe={(i, v) => `${formatDay(start, i)} · ${v} rides`}
  summary={`${total} rides in 20 weeks`}
/>;

data fills each column top to bottom, so with the default seven rows the first value should fall on the first day of a week. Cells are sized to fit the width, between 6 and 22 pt.

When to use

  • Habits and streaks over weeks or months: workouts, commits, practice, sales days.
  • Spotting rhythms, such as quiet weekends or a busy month, that a line chart flattens.

When not to use

  • Exact comparisons between days. Shades are bands, not values; use a bar chart.
  • Fewer than about three weeks of data. The pattern needs room to show.

Notes

  • Values are split into four shades relative to the busiest day; zero is the empty track.
  • Drag across the grid to read any day; tap the chosen day again to clear it.
  • With reduced motion the cells appear at once.

Props

HeatGridProps

PropTypeDefaultDescription
datarequiredreadonly number[]—One value per cell, oldest first, filling each column top to bottom.
accessibilityLabelrequiredstring—What the grid shows, e.g. "Rides, last 20 weeks".
rowsnumber7Cells per column. Defaults to 7, a week.
rowLabelsreadonly string[]['Mon', '', 'Wed', '', 'Fri', '', '']Labels down the left, one per row; empty strings leave a row unlabelled.
describe(index: number, value: number) => string(i, v) => `Day ${i + 1}: ${v}`Describes one cell for the readout and screen readers, e.g. "Tue 14 Oct · 3 rides".
summarystring—The readout while nothing is selected. Defaults to the total.
colorstring—Colour of the busiest cells. Defaults to the theme azure.
gapnumber3Space between cells. Defaults to 3.
onSelect(index: number | null) => void—Called with the cell under the finger, or null when the selection clears.
hapticsbooleantrueA tick as the finger moves from cell to cell. Defaults to true.
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
Five paths, one per shade, rebuilt on the UI thread only during the intro wave; at rest the canvas is static.
Measured

Pixel 9 emulator, API 35, release build · interaction median 0.85× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 159 MB app memory

Real-device measurement pending.

Accessibility

Reduced motion
Cells appear at once, without the wave.
Screen readers
An adjustable element: swipe up or down to step through days; the value reads the chosen day, or the total.
Touch target
The whole grid; cells are chosen by dragging, so their small size does not matter.

Source files

components/kinetik/heat-grid.tsx is in the Code tab of the preview above.