Installation
Add Reincharts to a React 18 or 19 project.
Install the packages you need (recommended)
Reincharts is split into small packages, so you only ship what you use. A typical interactive chart needs the core, a series package, axes, the crosshair and tooltips:
npm install @reincharts/core @reincharts/series @reincharts/axes @reincharts/coordinates @reincharts/tooltipAdd more as you need them:
| Package | Add it for |
|---|---|
@reincharts/annotations | Reference lines and areas, markers, labels |
@reincharts/interactive | Drawing tools, brush selection, zoom buttons |
@reincharts/indicators | Technical indicators (RSI, MACD, Bollinger...) |
@reincharts/datafeed | Loading data from a backend, realtime, replay |
@reincharts/widget | The complete <TradingChart> component |
Every example on this site imports from the individual packages:
import { ChartCanvas, Pane } from "@reincharts/core";
import { LineSeries } from "@reincharts/series";
import { XAxis, YAxis } from "@reincharts/axes";Or install everything
The umbrella package reincharts re-exports every @reincharts/* package from a single entry point. It is convenient
for prototypes; bundlers tree-shake what you don't use.
npm install reinchartsimport { ChartCanvas, LineSeries, Pane, XAxis, YAxis } from "reincharts";Requirements
- React 18 or 19 (
reactandreact-domare peer dependencies). - An ESM-aware bundler: Next.js, Vite, React Router, Rsbuild, webpack 5... Reincharts ships ES modules only.
- A browser with
<canvas>,ResizeObserverand Pointer Events, which is every evergreen browser. - TypeScript is optional but recommended; type definitions are included.
There are no other runtime dependencies.
Styles
Charts need no CSS: they render canvases and set their own inline styles. Only the DOM toolbars ship a small stylesheet; import it once if you use them:
import "@reincharts/interactive/styles.css"; // drawing toolbar, style toolbar, zoom buttons
import "@reincharts/widget/styles.css"; // <TradingChart> UI (includes the interactive stylesheet)With the umbrella package, import "reincharts/styles.css" includes both.