Frame and legend

Chart.Frame is the card a chart can sit in: a title, a description, one row for filters, and a caption underneath for the source or the caveat. It is optional — a chart dropped straight into a dashboard grid needs no card — and when it is used it is the standard card recipe, so a chart never invents its own container.

tsx
<Chart.Frame
  title="Revenue"
  description="Monthly recurring revenue"
  caption="Source: billing ledger"
>
  <Chart.Line categories={categories} series={series} />
</Chart.Frame>

The header only exists when at least one of title, description and actions is set, so a frame with none of them is a plain card around the plot.

Frame is not surface. The frame is a card with type in it, rendered around the chart; surface is the box the plot itself is painted on, and it exists on native too. Use the frame for a titled dashboard card, surface when the chart needs its own background or padding.

Frame props

PropTypeDefaultDescription
children*ReactNodeChart or composed visualization content.
titlestringHeading rendered above the chart.
descriptionstringSupporting text below the title.
actionsReactNodeFilters and controls aligned with the heading.
captionstringSource, method or caveat below the chart.
classNamestringCSS class applied to the frame.

Legend props

A chart renders its own legend from two series up, and none for a single one, so Chart.Legend is for the surface that places identity itself — one legend above a row of small multiples, or a legend that doubles as a series filter. Colors come in already resolved, so pin slot or color on the series and both agree by construction.

PropTypeDefaultDescription
items*ChartLegendItem[]Stable IDs, labels and resolved swatch colors.
classNamestringCSS class applied to the legend.