Skip to content
SENVENLI UI

Calendar heatmap

A value per day over weeks, as shaded cells in a calendar grid.
Orders per day
import { CalendarHeatmap } from "@senvenli/react/charts";

Examples

Fixed steps and a press

Your own thresholds keep the shading comparable between periods; a press opens the day.

Guidelines

When to use it

  • Daily activity over months.

Use something else when

  • The pattern is by weekday and hour, not by date. Heatmap
  • One status per day matters, not an amount. Tracker
  • The trend over time matters more than single days. Line chart

Accessibility

Keyboard

KeysWhat happens
Arrow keysMove between days.

Built in

  • A "Show as table" button shows the same data as a table, which screen readers get by default.

You provide

  • A title that says what the figure is.

API reference

CalendarHeatmap

title
string

What the chart shows, over it; leave it out when a card or a heading already says so.

aria-label
string

Names the chart when it has no visible title (a card's heading already says what it shows).

period
string
isLoading
boolean
emptyState
React.ReactNode

Shown instead of the plot when there is no data: an EmptyState size="small" or text; "No data" by default.

dataRequired
readonly CalendarHeatmapDatum[]
start
ChartDay

The first and last day drawn; the data's range by default.

end
ChartDay
thresholds
readonly [number, number, number, number]

Four ascending lower bounds of the four intensity steps; from the data's quartiles by default.

valueFormatter
ChartValueFormatterDefault plain
onDayPress
(day: { date: CalendarDate; value: number | undefined; }) => void