Skip to content
InsightCharts

Search

Search guides and components

Small multiple grid

Repeats any chart spec once per value of a facet field, each panel with its own filtered rows and a title, in a grid that follows the container width.

Use when
Faceting a chart form the small multiples atom does not draw: stacked bars, scatter plots, donuts, waffles, dumbbells, histograms. Also when each panel should be a full chart with its own tooltip and axis.
Avoid when
Line, area or bar facets that must share one value scale: use the small multiples atom, which draws every panel in one chart on a common axis. Here each panel scales to its own rows unless the spec fixes the axis (for example option: { xAxis: { max: 70 } }), so say so in the subtitle or fix it. More than about twelve panels.

Preview

65% of Dutch workers aged 25 to 34 worked from home usually or sometimes in 2023

Share of employed people working from home usually or sometimes, by age group, six EU countries, 2023. All panels run from 0 to 70%

  • Usually
  • Sometimes

Netherlands

Sweden

Germany

France

Spain

Italy

Source: Eurostat, Labour Force Survey · Rounded, illustrative

Composition

Built from

The pieces small multiple grid renders or expects in its slots.

Atoms

3

Compares a value across categories with bars from a zero baseline.

A standalone colour key: categorical swatches, or a sequential/diverging ramp with end labels.

Shows shares of a whole as counted cells in a grid, such as 37 in every 100.

Used in

1 template uses small multiple grid.

Templates

1

A long article read by scrolling. It has a headline, then an ordered list of blocks in a reading column, then a source note. The blocks are prose, figures, charts with a callout, scrolly sequences, pull quotes, stat rows, small multiples and chapter breaks. Exhibits can be wider than the column.

Installation

$ pnpm dlx shadcn@latest add @insightcharts/small-multiple-grid

The CLI copies the source into your project and needs the @insightcharts registry in components.json; see installation. With the package, import it by name:

import { SmallMultipleGrid } from "insightcharts";

Examples

Shared highlight, two columns, emphasised panel

44% of Dutch workers aged 25 to 34 usually worked from home in 2023

Share usually working from home, by age group, 2023. Panels are on their own scales

Netherlands

Germany

Spain

Italy

Illustrative data

A waffle chart in each panel

91% of people in Europe used the internet in 2023

Share of the population using the internet, by region, 2023

Europe

Americas

Asia-Pacific

Africa

Source: ITU Facts and Figures 2023 · Figures are approximate, for illustration

Props

PropTypeDefaultDescription
dataDataInputRows for every panel together. Omit inside <InsightData>.
transformTransform | Transform[]Applied before the rows are split by facet.
facetrequiredstringField whose values each get a panel.
chartrequiredInsightSpec | (facet, rows) => ReactNodeThe chart repeated in every panel: a spec without data and without a title, or a render function from JSX.
columnsnumberPreferred columns. Default: up to four, reduced to fit minPanelWidth.
minPanelWidthnumber200Narrowest a panel may get before the grid drops a column.
order"data" | "asc" | "desc" | string[]"data"Panel order: data order, alphabetical, or an explicit list of facet values.
panelHeightnumber160Plot height of each panel when the spec sets none.
highlightstring | string[]Passed to every panel as its highlight, so the same entity is emphasised everywhere.
emphasisstring | string[]Facet values whose panel titles are emphasised.
legend(string | { label, color?, index?, shape?, muted? })[]One shared colour key above the panels (legend-key items, in series order). Set legend: false in the chart spec so panels do not repeat it.
namesRecord<string, string>Display names for facet values.
level2 | 3 | 4 | 5 | 64Heading level of the panel titles.
titlestringThe main fact with its number, or a plain label.
subtitlestringMeasure, population, period, and whether the panels share a scale.
sourcestringShown under the grid as "Source: ...".
notestringMethod note or caveat.
themeThemeInputTheme override, passed on to every panel.
mode"auto" | "system" | "light" | "dark""auto"Colour mode.