Drop-in ready
One import registers the element globally. No framework setup, no build tool required when using the standalone CDN build.
<audio-visualizer>?Drop-in ready
One import registers the element globally. No framework setup, no build tool required when using the standalone CDN build.
Framework agnostic
Works in plain HTML, React, Vue, Angular, Svelte — anywhere you can write a custom element tag.
Faithful to LiveKit
Ported from LiveKit’s AgentAudioVisualizerBar. Uses the same dB-normalised
multiband analysis — the visual behaviour matches exactly.
Themeable
CSS custom properties (--audio-visualizer-color,
--audio-visualizer-transition) make it fit any design system.
Import the component into your MDX file:
<script type="module" src="https://cdn.jsdelivr.net/npm/@warrenbuckley/audio-visualizer/dist/audio-visualizer.standalone.js"></script>Add the element <audio-visualizer>
<audio-visualizer id="viz" size="md" style="--audio-visualizer-color: #6366f1"></audio-visualizer>
<button id="btn">Start microphone</button>Add script to trigger
<script type="module"> document.getElementById("btn").addEventListener("click", async () => { await document.getElementById("viz").startMicrophone(); });</script>Save as an .html file and open in any modern browser (served via HTTPS or localhost for mic access).