import { ChartMultiples } from "@elabs-ai/components-charts";npm install @elabs-ai/components-tokens @elabs-ai/components-ui @elabs-ai/components-chartsPaste it into Claude Code, Cursor, Codex or any other coding agent. Text in [brackets] is yours to fill in.
Add the brand-ui ChartMultiples chart (from @elabs-ai/components-charts) to this project. 1. Read https://elabs-ai.com/llms.txt first: it maps every package and the rules. If you can use MCP servers, connect https://elabs-ai.com/mcp and use its search, docs and tokens tools. If not, run the same lookups in the terminal: `npx -y @elabs-ai/components-cli search "<what you need>"` and `npx -y @elabs-ai/components-cli docs <Component>`. 2. Look ChartMultiples up before writing code: `npx -y @elabs-ai/components-cli docs ChartMultiples` prints its real props, variants, what it pairs with and what to avoid. 3. If @elabs-ai/components-charts is not installed yet: `pnpm add @elabs-ai/components-tokens @elabs-ai/components-ui @elabs-ai/components-charts` (or `npm install @elabs-ai/components-tokens @elabs-ai/components-ui @elabs-ai/components-charts`). If this is the first brand-ui package in the project, wire it once: import `@elabs-ai/components-tokens/styles.css` plus the `themes/light.css` and `themes/dark.css` stylesheets in the CSS entry, add one Tailwind `@source` line per installed @elabs-ai package (Tailwind does not scan node_modules, so without it everything renders unstyled), and wrap the app root in `ThemeProvider` from `@elabs-ai/components-tokens`. 4. Use it here: [the screen or file, and what it should show] 5. Rules: use only @elabs-ai/components-* components and the semantic tokens — no raw colours, no raw font sizes, no arbitrary Tailwind values. Look up each component's real props with the docs tool before you use it; never guess a prop. 6. Done means: the typecheck passes, `npx -y @elabs-ai/components-cli audit src --strict` reports nothing, and you have opened the app and looked at every screen you touched in the light and the dark theme.
Use it for
- many overlapping lines over time — one panel per series instead of a spaghetti chart, so each trend reads on its own
- one measure across many categories or groups — a grid of panels that share a scale, read as one picture
Avoid
- fewer than 3 panels, or the comparison IS the overlap — use one chart
Examples
Shared Scale Multiples
One shared scale: value labels paint on the first column only.
Sorted With Baseline Multiples
Sorted by % change, with the all-chip average repeated muted behind every panel.
Hide Panel On Narrow Multiples
The SRAM panel is hidden below 480 px only (`showAt: { base: true, narrow: false }`).
Explicit Narrow Density Multiples
The host names its narrow density (`{ base: "md", narrow: "md" }`), so the panels keep their value axes even on a phone-width grid.
From Chart Spec Multiples
The same shared-scale grid, emitted as a `ChartSpec` with `facet` and rendered by `AutoChart`.
Split Bars Multiples
Split bars: one panel per measure (`facet.by = { series: true }`), independent value scales.
Multiple Pies Multiples
Multiple pies: one pie per region (`facet.by = "region"`).
API
ChartMultiples
| Prop | Type | Description |
|---|---|---|
data | T[] | Long rows, split into panels by `by`. Ignored when `panels` is set. |
by | string | { series: true } | A column key (one panel per value), or `{ series: true }` — one panel per `dataKeys` entry over the same rows (split bars). |
panels | ChartMultiplesPanelInput<T>[] | Explicit panels (instead of `data` + `by`). |
xDataKeyrequired | string | Row key of the x value (hover lookup, shared x extent, baseline join). |
dataKeysrequired | string[] | Row keys of the plotted values; the first drives sort, stats and the hovered value. |
columns | Responsive<number | "auto"> | Panels per row, per breakpoint. Default `{ base: "auto", narrow: 1 }`. |
minPanelWidth | number | Minimum panel width `columns: "auto"` packs to. Default 240. |
panelHeight | Responsive<ChartPlotHeight> | Each panel's plot height (px or `{ aspect }`), per breakpoint. Default 200. |
scales | ChartMultiplesScales | |
sort | FacetSort | Panel order. Default `"data"` (input order). Numeric keys sort largest first. |
reverse | boolean | Reverse the sort order. |
baseline | ChartMultiplesBaseline | A series drawn muted behind every panel's own series: a panel `key` (removed from the grid) or a row `series` key. |
showAt | (panel: ChartMultiplesPanel<T>) => Responsive<boolean> | Per-panel visibility, per breakpoint (a panel's own `showAt` wins). |
syncHover | boolean | Synced hover: every panel shows the crosshair at the hovered category and `panelTitle` receives the hovered value. Line, Area and Composed panels only; bar and pie panels get the shared layout and domains. Default `true`. |
panelTitle | (panel: ChartMultiplesPanel<T>, hovered?: ChartMultiplesHover<T>) => ReactNode | Title slot; `hovered` is set while any panel is hovered (value-in-title). |
annotations | Array<ChartAnnotation & { panel?: string }> | Annotations; `panel` names one panel, `"all"`/unset repeats it in every panel. |
childrenrequired | (panel: ChartMultiplesPanel<T>) => ReactNode | Renders one panel's chart. |