npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vaudio/react

v0.2.4

Published

React components and hooks for audio visualization

Readme

@vaudio/react

React bindings for the @vaudio/core audio visualization library

Use @vaudio/react to bring your custom @vaudio/core visualizer objects into a React app with a declarative, component-based API.


📦 Installation

npm install @vaudio/react @vaudio/core three

🧪 Quick Start

import { Visualizer } from '@vaudio/react';
import { MyVisualizer } from './visualizers/MyVisualizer';

export default function App() {
  return (
    <Visualizer
      audioOptions={{ src: '/music.mp3' }}
      cameraOptions={{ z: 10 }}
      backgroundColor="black"
    >
      <MyVisualizer id="wave" size={2} color="red" />
    </Visualizer>
  );
}

Live input (MediaStream)

const stream = await navigator.mediaDevices.getUserMedia({ audio: true });

<Visualizer mediaStream={stream}>
  <MyVisualizer id="wave" />
</Visualizer>;

🔧 API

Visualizer

The root component that sets up the Three.js scene, manages audio analysis, and provides context for child visualizers.

Props:

  • audioOptions – passed to <audio> element
  • mediaStream – optional MediaStream (mic/WebRTC/etc). When provided, it is analyzed instead of the <audio> element
  • connectStreamToDestination – if true, routes the MediaStream to speakers (monitoring). Defaults to false to avoid feedback
  • cameraOptions{ fov, x, y, z }
  • backgroundColor – scene background
  • fps – target frames per second
  • containerProps – props passed to the outer container

withReact()

Turns a createVisualizerObject() builder into a React component.

const MyVisualizer = withReact(
  createVisualizerObject()
    .defaults(() => ({ size: 1, color: 'blue' }))
    .geometry(({ layer }) => new THREE.BoxGeometry(layer.size))
    .material(({ layer }) => new THREE.MeshStandardMaterial({ color: layer.color }))
    .render()
);

<MyVisualizer.asVisualizerComponent() size={2} color="hotpink" />

createVisualizerComponent()

Lower-level API for wrapping @vaudio/core render functions as React components. Useful when not using the builder pattern.

const Cube = createVisualizerComponent(defaults, renderFn);

<Cube id="cube1" size={2} />

🧠 Hooks & Context

useVisualizer()

Access runtime scene, audio analysis, and rendering control.

const { triggerRender, dataArrayRef } = useVisualizer();

🧱 Example Visualizer File

// MyVisualizer.ts
export const MyVisualizer = withReact(
  createVisualizerObject()
    .defaults(() => ({ size: 1, color: 'cyan', domain: 'frequency' }))
    .geometry(({ layer }) => new THREE.SphereGeometry(layer.size, 32, 32))
    .material(({ layer }) => new THREE.MeshStandardMaterial({ color: layer.color }))
    .render(({ mesh, audioData }) => {
      const avg = audioData.reduce((a, b) => a + b, 0) / audioData.length;
      const scale = 1 + avg / 256;
      mesh.scale.set(scale, scale, scale);
    })
);

🧩 Related

  • @vaudio/core – core builder system for defining visualizer objects

📘 License

MIT