Download

visx Download and Installation: npm, Yarn and pnpm

visx isn't a desktop program or a single file. It's a set of JavaScript packages published on the npm registry, so "downloading visx" means adding those packages to a React project with a package manager. Here's how to do that cleanly, plus how to get our ready-made starter project if you'd rather skip the setup.

Before you install

Check three things first:

  • Node.js: any current LTS release works for installing visx. If you use our Vite-based starter kit, Vite 8 needs Node.js 20.19+ or 22.12+.
  • React version: visx 4 supports React 18 and 19. Run npm ls react to see yours.
  • A React project: Vite, Next.js, Remix, Create React App and plain webpack setups all work.

Option 1: Install individual packages (recommended)

Each visx package does one job. Install the ones your charts import:

# npm
npm install @visx/shape @visx/scale @visx/group @visx/axis

# Yarn
yarn add @visx/shape @visx/scale @visx/group @visx/axis

# pnpm
pnpm add @visx/shape @visx/scale @visx/group @visx/axis

Commonly added packages:

PackageWhat it gives you
@visx/gridBackground grid lines
@visx/responsiveParentSize and useParentSize for fluid widths
@visx/tooltipTooltip hooks and components
@visx/eventlocalPoint for pointer positions
@visx/curveCurve factories such as curveMonotoneX
@visx/gradientSVG gradient definitions
@visx/xychartA higher-level API with built-in series, axes and tooltips

Option 2: Install everything with @visx/visx

npm install @visx/visx

The umbrella package re-exports every visx package. It's handy for prototypes and learning, but the install is larger, and individual packages make your dependencies easier to read. Most production apps install packages one by one.

Keep every @visx package on the same major version

The official visx 4 migration notes say to upgrade all @visx/* packages together and not to mix v3 and v4. Mixed versions are a common cause of confusing TypeScript errors. After installing, run:

npm ls | grep @visx

Every line should show the same major version (4.x at the time of writing).

TypeScript users

visx ships its own type definitions. In visx 4, @types/react and @types/react-dom became optional peer dependencies, so install the versions that match your React release yourself:

npm install -D @types/react @types/react-dom

Option 3: Download our starter project

If you want a working project in two commands, download the visx React starter kit. It's a ZIP of plain source files: Vite, React 19, TypeScript and twelve chart components. We type-check and build it against visx 4.0.0 before publishing.

npm install
npm run dev

Verify the install

Drop this into any component. If you see a purple square, everything is wired up:

import { Bar } from '@visx/shape';

export function Check() {
  return (
    <svg width={60} height={60}>
      <Bar x={10} y={10} width={40} height={40} fill="#4f46e5" />
    </svg>
  );
}

If the import fails, see visx troubleshooting. Before installing, it's also worth reading our note on safe installs and the MIT license.