Back to Charts

Primitives

ChartFrame

Shared figure shell for chart title, description, metrics, legend, body, and footer. Chart components compose this rather than duplicating header chrome.

Examples

Frame with metrics and legend

Visitors Showing total visitors for the last 6 weeks. Desktop 1,749 Mobile 1,351 Desktop Mobile
<ChartFrame
  title="Visitors"
  description="Showing total visitors for the last 6 weeks."
  metrics={[
    {label: 'Desktop', value: '1,749', color: 'var(--uin-chart-1)'},
    {label: 'Mobile', value: '1,351', color: 'var(--uin-chart-2)'}
  ]}
  legend={[
    {key: 'desktop', label: 'Desktop', color: 'var(--uin-chart-1)'},
    {key: 'mobile', label: 'Mobile', color: 'var(--uin-chart-2)'}
  ]}
>
  <svg>...</svg>
</ChartFrame>

Props

PropTypeDefaultDescription
titlestringOptional chart title rendered in the figure caption.
descriptionstringOptional supporting copy below the title.
legendChartLegendItem[][]Legend items rendered in the header.
metricsChartMetric[][]Header metrics for interactive chart summaries.
footerSnippetOptional footer slot for trend copy or notes.
childrenSnippetChart body, usually an SVG plus optional overlay tooltip.

Install

CLI

npx @a3tai/mittsu add chart-frame --registry ./packages/charts/registry.json