Skip to content
GaudiGaudi Design System home

Search documentation

Search every page, heading and paragraph.

ChartFrame

The frame every chart renders in: a captioned figure with one keyboard stop and a readout, loading, empty, invalid and error states, locale-aware numbers and a data table built from points.

Charts@gaudi/design-system/charts/ChartFrameView in StorybookSource

Use it around a custom visual, with the Recharts composition parts and Gaudi primitives.

Installation

pnpm add github:ahmadassaf/design-system recharts

Import from @gaudi/design-system. Load @gaudi/design-system/global.css once and add transpilePackages: ['@gaudi/design-system'] in Next.js.

import { ChartFrame } from '@gaudi/design-system/charts/ChartFrame';

Copy an example into your project with the shadcn CLI: npx shadcn@latest add https://design.gaudi.site/r/chart-frame-states-locale.json.

Usage

import { ChartFrame, useChartFrame } from '@gaudi/design-system/charts';
<ChartFrame title='Writing goals' ariaLabel='Progress towards writing goals' points={points} showData='toggle'> <GoalBars /></ChartFrame>

Examples

Loading, empty, invalid, error and locale

Storybook

API

19 props

Accessibility

The plot is one tab stop named by ariaLabel. The arrow keys walk the points, Home and End jump to the ends, Enter or Space activates and Escape clears; the active point is drawn and read out politely. Every value is mirrored in a data table, and the SVG is hidden from assistive technology.