Skip to content

Recharts vs visx

Which should you use? A side-by-side look at what each one does, who it suits, what it costs, how hard it is to set up, and where each falls short.

Recharts

Open source · MIT

A React charting library built on D3 for drawing charts from declarative components.

visx

Open source · MIT

A set of reusable React building blocks for drawing custom charts, built on d3 math.

The short answer

Choose Recharts if you need…

  • React developers who need standard charts such as line, bar or similar graphs in a web app
  • Teams that prefer declarative, component-based chart code
  • Single-page applications installed through npm
  • Developers who want SVG-based charts with minimal dependencies

Choose visx if you need…

  • React developers who want full control over how a chart looks and behaves
  • Teams building their own reusable chart library on top of shared components
  • Developers who already know d3 and want its math without its DOM update style
  • Projects that want to keep bundle size small by importing only needed packages

Side-by-side

Rechartsvisx
TypeLibraryLibrary
PriceFree and open sourceFree and open source
LicenceMITMIT
GitHub stars27.7k21.1k
Setup difficultyBeginnerIntermediate
How you get itInstall with a package managerInstall with a package manager
Main languageTypeScriptTypeScript
Last code update4 days ago5 months ago

What each one is

Recharts

Recharts is a charting library for React applications, built on top of D3. You draw charts by composing React components such as a line chart, axes, a grid and a tooltip, each of which is a separate part you can combine. It renders charts as native SVG and is aimed at making charts in React apps straightforward.

visx

visx is a collection of low-level visualization components for React. It uses d3 for the calculations and math, while React handles updating the page, so developers can build charts without writing d3 selection code by hand. You install only the small packages you need, such as shapes or scales, and combine them into your own charts.

Best for

Recharts

  • React developers who need standard charts such as line, bar or similar graphs in a web app
  • Teams that prefer declarative, component-based chart code
  • Single-page applications installed through npm
  • Developers who want SVG-based charts with minimal dependencies

visx

  • React developers who want full control over how a chart looks and behaves
  • Teams building their own reusable chart library on top of shared components
  • Developers who already know d3 and want its math without its DOM update style
  • Projects that want to keep bundle size small by importing only needed packages

Strengths

Recharts

  • Declarative API where each chart part is an independent React component
  • Native SVG output with a stated focus on being lightweight with minimal dependencies
  • MIT licensed with active development and a documentation site and storybook

visx

  • Components are low-level and unopinionated, so you control the final look
  • Lets you use d3 math without managing d3 selections or enter/exit/update logic
  • Modular packages mean you only include what you use

Not ideal for

Recharts

  • Non-programmers who want to make charts without code, since it requires writing React components
  • Projects not using React, because the library is built around React components
  • Very large datasets needing canvas or GPU rendering, since the README only describes SVG support

visx

  • People who want ready-made charts with no coding, since visx provides building blocks rather than finished charts
  • Projects that need built-in animation, because the README says visx deliberately does not include animation and suggests using existing React animation libraries instead
  • Projects not using React, since the components are built for React 18 or 19

Trade-offs

Recharts

  • Only suited to React projects, so it does not fit other frameworks by default
  • Installation asks you to also install react-is matching your React version, an extra step for beginners
  • The README excerpt provides limited detail on specific chart types and advanced options; see the docs site

visx

  • Because it is low-level, you write more code than with a turnkey charting library
  • No built-in animation; you must add a React animation library yourself if you want it
  • Requires React 18 or 19 for the current v4 release, so older React projects need migration (see the migration guide)

Getting started

Recharts

Install with npm

npm install recharts react-is
Step-by-step guide: how to use Recharts

visx

Install the packages used in the README example

npm install --save @visx/mock-data @visx/group @visx/shape @visx/scale
Step-by-step guide: how to use visx

Frequently asked questions

What is the difference between Recharts and visx?

Recharts: A React charting library built on D3 for drawing charts from declarative components. visx: A set of reusable React building blocks for drawing custom charts, built on d3 math. Recharts suits react developers who need standard charts such as line, bar or similar graphs in a web app, while visx suits react developers who want full control over how a chart looks and behaves.

Are Recharts and visx free?

Recharts: Free and open source. visx: Free and open source.

Which is easier to set up, Recharts or visx?

Recharts is easier to get started with (rated beginner); visx is rated intermediate and usually needs more setup.

Is Recharts or visx more popular?

Recharts has more GitHub stars (27.7k) than visx (21.1k). Popularity isn't the same as fit — check which one matches your use case above.

What are other alternatives to Recharts and visx?

Other options people compare them with include Chart.js, nivo, Plotly.js, shadcn/ui, Base UI.

Keep comparing

Built from our catalogue entries for both products: open-source details come from each project's README (AI-assisted, refreshed weekly) and GitHub data; AI-tool details are editorial. Spotted something wrong? Let us know from either product's page.