An audio waveform, from a file or a live microphone, with scrubbing.
string |
| – |
The colour of bars not yet played, as a CSS colour. Defaults to the |
barGap | number | 2 | The space between bars, in pixels. |
barRadius | number | 1.5 | The corner radius of each bar, in pixels. |
barWidth | number | 3 | The width of each bar, in pixels. |
data | number[] | – | The bar heights to draw, each from 0 to 1. They are stretched to fill the width. |
defaultValue | number | – | The playback position at first, when it isn't controlled. |
deviceId | string | – | The microphone to record from, as a |
duration | number | 1 | The total length, in the same unit as |
fadeEdges | boolean | true | Whether the bars fade out towards the left and right edges. |
fadeWidth | number | 24 | How far the fade reaches in from each edge, in pixels. |
labels | Partial<WaveformLabels> | – | Replaces the built-in text for this instance. See |
microphone | boolean | false | Whether to record from the microphone while |
mode | "static"|"scrolling"|"live" | static | How live input is drawn: |
onMicrophoneError | ((error: unknown) => void) | – | Called when the microphone can't be used, for example when the user denies permission or no microphone is connected. |
onValueChange | ((value: number) => void) | – | Called with the new position when the user clicks or drags to seek. |
processing | boolean | false | Whether to show a gently moving wave, for example while an assistant is thinking. Ignored while |
progressColor | string | – | The colour of played bars and of live input, as a CSS colour. Defaults to the |
seed | number | 42 | A number that picks the placeholder waveform drawn when there's no |
sensitivity | number | 1 | How strongly microphone input moves the bars. Raise it for quiet input. |
updateRate | number | 30 | How often to sample the microphone, in milliseconds. |
value | number | – | The playback position, in the same unit as |
Accepts every native attribute of the element it renders.
Accepts render, plus every native <div> attribute.
Accepts render, plus every native <div> attribute.