⚡ ComponentForge

Chart card

Data display

Dependency-free SVG bar/line charts wrapped in card chrome. Series colors map onto token variables so charts follow the theme automatically.

import { ChartCard } from "@componentforge/react";

Examples

Bar / line toggle

Weekly active users

Rolling 6 weeks

02505007501000W1: 420W2: 465W3: 512W4: 498W5: 561W6: 604W1W1W2W2W3W3W4W4W5W5W6W6
Props

Accessibility

  • SVG carries role="img" with a generated aria-label summary (title, series, magnitude) — override with ariaSummary.
  • Per-point <title> provides hover/focus tooltips natively.
  • Loading/error/empty states reuse the shared States primitives.

Keyboard interactions

KeyAction
HoverNative tooltips per bar/point.

API reference

Selected props — every component also spreads native HTML attributes.

PropTypeDefaultDescription
type"bar" | "line""bar"Renderer.
series / labelsChartSeries[] / string[]values arrays share the label axis.
formatValue(n: number) => stringString(n)Tick + tooltip formatting.
loading / error / onRetryState slots.