Ruixen Pro is now live.50+ premium components, templates, blocks, and lifetime updates.

Command Palette

Search for a command to run...

Docs
Live Waveform

Live Waveform

Canvas-based real-time waveform visualizer with processing animation, microphone input, and stop controls.

Installation

Usage

import LiveWaveform from "@/components/ruixen/live-waveform";
 
export default function App() {
  return <LiveWaveform processing onStop={() => console.log("stopped")} />;
}

Props

PropTypeDefaultDescription
activebooleanfalseEnable real-time microphone visualization
processingbooleanfalseShow animated processing wave pattern
barWidthnumber3Bar width in pixels
barGapnumber2Gap between bars in pixels
barRadiusnumber1.5Bar corner radius
barColorstring-Bar color (inherits currentColor when unset)
heightnumber48Waveform height in pixels
fadeEdgesbooleantrueApply gradient fade at edges
fadeWidthnumber24Fade gradient width in pixels
sensitivitynumber1Microphone sensitivity multiplier
onStop() => void-Callback when stop button is pressed
classNamestring-Additional CSS classes

States

The component has three visual states:

  • Idle: Flat minimal bars at low opacity (neither active nor processing)
  • Processing: Animated oscillating wave pattern with stop button
  • Active: Real-time microphone frequency visualization with stop button