---
title: "Installation"
description: "Install the package and render your first spectrum in under a minute."
canonical_url: "https://www.fftvisualizer.com/react/installation"
---
# Installation

> Install the package and render your first spectrum in under a minute.

Prefer to poke at it first? The [live playground](https://demo.fftvisualizer.com/react/)
runs this exact package with every option exposed.

## Install

<code-group>

```bash [pnpm]
pnpm add @fft-visualizer/react
```

```bash [npm]
npm install @fft-visualizer/react
```

```bash [yarn]
yarn add @fft-visualizer/react
```

</code-group>

React 18 and 19 are both supported, and React is the only peer dependency.

Import the stylesheet once, anywhere in your app — it sizes the canvas and styles the stats
overlay:

```ts
import '@fft-visualizer/react/style.css'
```

## Quick start

The fastest way to see something is **local mode** — capture the microphone and visualize
it entirely in the browser, no backend required:

```tsx
import { FFTVisualizer } from '@fft-visualizer/react'
import '@fft-visualizer/react/style.css'

export function Viz() {
  // The component fills its container — give it a height
  return (
    <div style={{ width: '100%', height: 240 }}>
      <FFTVisualizer mode="local" bands={40} gradient="aurora" />
    </div>
  )
}
```

The browser prompts for microphone permission on mount. To capture tab or system audio
instead of the mic, set `audioSource="display"`.

<note>

The component fills its container, so the wrapper needs a defined height.

</note>

## Next.js & React Server Components

The component renders on the server (every browser API is touched inside `useEffect`), but
it needs the browser to do anything — so it belongs in a client component:

```tsx
'use client'

import { FFTVisualizer } from '@fft-visualizer/react'
```

<note>

`mode="local"` is one of three [data modes](https://www.fftvisualizer.com/guide/data-modes). Every prop maps to a shared
[option](https://www.fftvisualizer.com/guide/options); see [Props, callbacks & ref](https://www.fftvisualizer.com/react/props) for the React-specific API.

</note>


## Sitemap

See the full [sitemap](https://www.fftvisualizer.com/sitemap.md) for all pages.
