Props for the Waveform component.
| Property | Type | Description | Inherited from |
|---|
amplitudeScale? | number | Multiplier applied to audio sample amplitudes for gain adjustment. Default 1.0 | WaveformOptions.amplitudeScale |
audio? | HTMLAudioElement | - | - |
autoRender? | boolean | Whether to automatically re-render when viewport or configuration changes. Default true | WaveformOptions.autoRender |
autoResize? | boolean | Whether to automatically resize canvas pixel resolution when container dimensions change. Default true | WaveformOptions.autoResize |
backgroundColor? | string | Background fill color for the canvas. Default "transparent" | WaveformOptions.backgroundColor |
canvasProps? | HTMLAttributes<HTMLCanvasElement> | - | - |
channel? | number | Audio channel index to visualize (0 for left/mono, 1 for right). Default 0 | WaveformOptions.channel |
className? | string | - | - |
color? | string | Primary color for the waveform line or bars. Default "#38bdf8" | WaveformOptions.color |
colorMap? | ColorMapConfig | Named colormap or palette configuration used to derive a matching solid color. Samples a representative accent color from the palette to align with spectrogram visuals. Overrides the color property when specified. Default undefined | WaveformOptions.colorMap |
devicePixelRatio? | number | boolean | Device pixel ratio scaling factor for HiDPI/Retina displays. Default window.devicePixelRatio | WaveformOptions.devicePixelRatio |
height? | string | number | - | - |
navigation? | boolean | NavigationOptions | - | - |
onReady? | (viewer: WaveformViewer) => void | - | - |
playheadClassName? | string | - | - |
playheadStyle? | CSSProperties | - | - |
renderer? | WaveformRendererMode | Rendering engine: - “canvas2d”: Standard 2D canvas line/envelope renderer. - “webgl2”: Hardware-accelerated GPU shader renderer. - “bars”: Segmented pill/bar waveform renderer. - Custom object with bar configuration options ({ type: "bars", barWidth, barGap, ... }). Default "canvas2d" | WaveformOptions.renderer |
scope? | Sonoscope | null | - | - |
showPlayhead? | boolean | - | - |
source? | AudioSource | - | - |
style? | CSSProperties | - | - |
url? | string | - | - |
width? | string | number | - | - |