← All elements
<label class="vm"><input type="checkbox" aria-label="Play voice message"><i></i><span class="w"></span><small>0:14</small></label>About this wave
A voice note bubble with a waveform that fills with colour while playing, toggled by a checkbox.
How it works
The waveform is one element masked into bars by a list of small gradient rectangles. Its background is half dark and half pale and twice as wide as the element. Checking the hidden box slides that background over 14 seconds, filling the bars, and swaps the play icon for pause.
Ways to customise it
- Change the transition time to match your clip length.
- Edit the mask heights for another waveform.
- Change the purple shades and the time label.
Good to know
This shows progress visually but plays no sound, so connect it to an audio element. Pausing here rewinds the fill, which a script can handle properly.
Open an example, copy the HTML and the CSS, and paste them into your page. There is nothing to install and no JavaScript to load.