Skip to content
TrademarkTrademark
Docs
Data

Building blocks

Updated: November 12, 2026
View on GitHub

When none of the charts fits, such as a calendar heatmap, a funnel or a map with values, build the visual yourself and give it the same frame as the charts. These parts are what every chart uses, so a custom visual next to a LineChart reads as one system.

ChartHeader

The title, description and date-range picker on top of every chart. It renders nothing when it has neither a title, a description nor a selector.

Type
Default
title
The heading.
ReactNode—
description
The line under it.
ReactNode—
date
The same date config a chart takes; date.selector shows the picker.
DateConfig—
dateRange
The range the picker shows as picked.
DateRange—
onDateRangeChange
Called with the range the reader picks.
(range: DateRange) => void—
presets
Quick ranges beside the calendar.
PresetsConfig{ display: true, granularity: "week" }

It takes the Column props too, for padding and borders.

ChartStatus

The loading spinner, the error message or the empty message, centred in whatever box it sits in. Loading wins over an error, and an error over empty. It renders nothing when none is set.

Type
Default
loading
Show the spinner.
booleanfalse
error
Show errorState.
booleanfalse
empty
Show emptyState.
booleanfalse
errorState
The error message.
ReactNode"An error occurred while fetching data"
emptyState
The empty message.
ReactNode"No data available for the selected period"

ChartSummary

The hidden table every chart carries for screen readers: the x values as rows, a column per series, every value in the chart's format. Give a custom visual the same, from the same rows, so its numbers are reachable without sight.

Type
Default
data
The rows, as a chart takes them.
DataPoint[]—
series
The columns. Without it, every key but the x key.
SeriesConfig | SeriesConfig[]—
xKey
The row key for the first column.
string—
kind
pie adds each row's share of the total.
"cartesian" | "pie"cartesian
valueFormat
How values are written.
ValueFormat—
locale
The locale they are written in.
stringen-US
date
Writes date x values with date.format.
DateConfig—
title
Used for the caption: "Title: data".
string—
caption
The table's caption, in place of the one from the title.
ReactNode—

Swatch

The colour sample in legends and tooltips, in the chart variant's fill.

color is a CSS colour as written: use var(--data-emerald) for a palette hue, since a bare "emerald" is the CSS named colour here. size is "s" or "m", and variant defaults to the app's chart variant.

useDataTheme

The chart settings from DataThemeProvider, the dataStyle section of your config, and a setter:

Read axis.stroke and tick.fill to draw your own axes in the charts' colours, and height to match their size. setChartOptions({ mode: "divergent" }) changes every chart under the provider; see Recipes.

Edit this page on GitHub