Native Solid 2 fork of solid-recharts (MIT, © Thomas Guehenneux), derived from Recharts (MIT, © recharts). Adapted documentation; neither project endorses this fork.

Introduction

Composable SVG charts for native Solid 2 that accept Radix Themes tokens as colors.

@wsagency/radix2solid-charts is the charting package of Radix2Solid. It is a source copy of solid-recharts 2.0.0-beta.1 (commit b1f9c67), a Solid port of the Recharts component model, compiled with the same native Solid 2 toolchain as Primitives, Icons and Themes.

You declare a chart container, its axes, grid, tooltip and series as JSX children. Colors take any CSS value. Charts does not read Themes by itself, and its built-in defaults are fixed colors. Pass Themes tokens such as var(--accent-9), as the examples on this site do, and those colors follow the surrounding Theme's accent color and light or dark appearance.

Visitors by monthJanFebMarAprMayJun
() => {
const data = [
{ month: "Jan", visitors: 4000 },
{ month: "Feb", visitors: 3000 },
{ month: "Mar", visitors: 2000 },
{ month: "Apr", visitors: 2780 },
{ month: "May", visitors: 1890 },
{ month: "Jun", visitors: 2390 },
];
return <ResponsiveContainer width="100%" height={240} initialDimension={{ width: 560, height: 240 }}>
<LineChart data={data} title="Visitors by month">
<CartesianGrid strokeDasharray="3 3" stroke="var(--gray-a6)" />
<XAxis dataKey="month" />
<YAxis />
<Tooltip />
<Line type="monotone" dataKey="visitors" stroke="var(--accent-9)" strokeWidth={2} />
</LineChart>
</ResponsiveContainer>;
}

Chart families

The package exports the twelve chart families inherited from solid-recharts: LineChart, AreaChart, BarChart, ComposedChart, ScatterChart, PieChart, RadarChart, RadialBarChart, FunnelChart, Treemap, Sankey and SunburstChart. Axes, grids, reference lines and areas, Brush, ErrorBar, Tooltip, Legend, labels, shapes, hooks and animation controllers are exported too.

Upstream and parity

SourceVersionCommit
solid-recharts, imported source2.0.0-beta.1b1f9c6729eefb42caf96d2162ad8c71c2c5520e3
Recharts, reference that solid-recharts tracks3.9.2b3451050c027a23957ffa50a2665c9119df21e47
Recharts, tracked release with selected adaptations only3.10.1ffb918798051ef040bb7f9922d3850c9c189f39f

The base props follow the Recharts 3.9.2 reference as implemented by solid-recharts. The published 0.1.0-rc.3 release candidate adds only the selected A1–A13 adaptations and B1/B2 ReduceCSSCalc fixes described in the release scope. Public additions are Legend position/offset/auto layout and XAxis auto height, and Sankey accessibility props. This is not complete Recharts 3.10.1 parity: CartesianGrid theme support remains deferred, no canary APIs are included, and React-only APIs such as Customized and element cloning are not part of the Solid API. The package's UPSTREAM.md and upstream.json preserve the imported baseline and record each selected adaptation.

Controlled Brush follows the imported Recharts behavior: a dragged slide keeps its position after mouseup even when controlled index props did not change. That is deliberately different from parent-authoritative controlled refusal in the new Primitives families; see the migration guide.

Licensing

The package is MIT licensed. Its LICENSE keeps the solid-recharts copyright (© Thomas Guehenneux) and the Recharts copyright (© recharts). Neither project endorses this fork. Its runtime dependencies d3-scale and d3-shape stay external and install as separate ISC-licensed packages. The package's NOTICE reproduces the license of each resolved D3 package (d3-scale, d3-shape and their dependencies, including internmap); when your bundler inlines them, keep those notices with your build.