An open-source React library for interactive 3D bar and surface charts, built on Three.js and React Three Fiber, that stays smooth on mobile and uses no GPU when the chart is idle.
Highlights
Two chart types, one API. Ships Bar3DChart and Surface3DChart. Both take single-series or multi-series data, axis and tick labels, value labels, grid toggles and color schemes (named palettes, hex codes or gradient stops), with sensible defaults so one line of JSX gives you a finished chart.
Camera that frames itself. The camera automatically fits the chart and all its labels on load, and refits when the container resizes or the data changes. Zoom moves toward the cursor, zoom limits adjust to the chart’s size, panning can’t drag the chart out of view, and rotation is limited so the grid walls stay behind the data.
Controls that work with the page, not against it. Plain scrolling and one-finger swipes still scroll the page; ⌘/Ctrl + scroll, pinch and two-finger drag control the chart. There’s an on-screen rotate/zoom/reset toolbar, a hint the first time you use a chart, and support for prefers-reduced-motion. The toolbar can be themed with CSS custom properties.
Performance-first rendering. Charts redraw only while something is changing, pause completely when scrolled off-screen, cap the device pixel ratio on high-DPI phones, and run their intro animations directly in the render loop without triggering React re-renders. The surface chart’s point markers are drawn in a single batch (instanced meshes).
Click and hover interactivity. Hover tooltips on every chart, plus an onBarClick callback that returns the value, indices and labels of the clicked bar or nearest surface point, for drill-downs and linked views.
Production-ready packaging. Written in TypeScript with full prop types. Bundled with Rollup as ESM and CommonJS, published to npm with React, Three.js and React Three Fiber as peer dependencies, and works in the Next.js App Router. Every chart variant is documented and visually tested in Storybook (hosted on Chromatic). Try it in the live playground at www.tricharts.com.