Wave Bars
Equalizer-style bars that bounce in a staggered rhythm.
<div class="flex h-10 items-end gap-1.5"> <span class="h-4 w-1.5 animate-bounce rounded-full bg-indigo-500 [animation-delay:-0.5s]"></span> <span class="h-8 w-1.5 animate-bounce rounded-full bg-indigo-500 [animation-delay:-0.25s]"></span> <span class="h-5 w-1.5 animate-bounce rounded-full bg-indigo-500"></span> <span class="h-9 w-1.5 animate-bounce rounded-full bg-indigo-500 [animation-delay:-0.15s]"></span> <span class="h-6 w-1.5 animate-bounce rounded-full bg-indigo-500 [animation-delay:-0.35s]"></span> </div>
Free to use in personal and commercial projects. No attribution required.
Variants
Same component, different looks. Preview each one live and copy the code you like.
Emerald
Emerald bars suit voice recorders and audio notes where green means recording is live.
Tall
The tall version works as a hero visual for music apps and podcast players.
Monochrome
The monochrome version fits minimal interfaces where color would distract from the content.
About this wave bars
Wave bars are the little equalizer you see in audio players and voice recorders: five vertical bars bouncing at different phases like a live sound meter. It tells users something audio-related is happening even when there is no waveform to show yet.
The bars use animate-bounce with staggered negative animation-delay values, the same technique as typing dots, so each bar starts mid-bounce at a different point in the cycle. items-end anchors every bar to the baseline while varying heights keep the silhouette uneven and organic. It is all transform animation, so it stays smooth.
Use it for audio loading states, voice recording indicators, podcast players buffering, and music app placeholders. It reads as sound even at tiny sizes, which makes it more meaningful than a generic spinner in audio contexts.
Audio interfaces have a unique problem: when the microphone is hot but nobody is speaking yet, the screen looks dead and users wonder if recording started. Wave bars solve it with the visual language of an equalizer, five bars bouncing at different phases that say the audio path is live without needing a real waveform. It is reassurance, not measurement.
Each bar reuses the bounce keyframes with its own negative delay, so the row ripples with no custom CSS at all. items-end anchors every bar to a shared baseline while differing heights keep the silhouette uneven and organic. The animation is transform-only, so it stays cheap even on low-end phones.
Cap the bars between 12 and 24: fewer reads as decoration, more reads as noise. Vary the bar widths slightly, not just heights, for a more organic waveform; uniform bars look like a fence. Round the bar caps fully so the tops feel soft rather than digital. For the idle state, slow the animation to half speed; fast bars with no audio playing feel like the interface is lying.
The uncanny version runs the bars at full energy while the audio is silent or paused, which reads as a broken meter rather than a live one. Tie the animation state to reality: freeze or calm the bars when there is no signal, and reserve the lively wave for actual activity. An equalizer that dances to silence looks like a bug, not a feature.
Where to use it
- ✓ Audio players buffering a track
- ✓ Voice message recording indicators in chat apps
- ✓ Podcast episode loading placeholders
- ✓ Music app now-playing animations
Customization tips
Add or remove spans to change the bar count, and vary the h- utilities for a wilder or calmer wave. Recolor with any bg utility, and tune the stagger by editing the negative delays; evenly spaced delays look rhythmic, random ones look organic.
Design notes
When to use
Wave bars signal live audio activity, making them a natural fit for voice recorders, music players, and call screens. The staggered heights read as sound even without audio playing, which is why the pattern is instantly recognizable. They work as a compact status indicator where a full waveform visualization would be overkill.
What to avoid
Do not use wave bars as a generic loading animation, users will wait for audio that never comes. Avoid the pattern in quiet contexts like a library app where the audio metaphor clashes with the content. And do not run the animation at full speed forever in a background tab, it wastes battery for no viewer.
Accessibility
The animation is decorative, so hide it from screen readers and provide a text status like recording nearby. Respect prefers-reduced-motion by freezing the bars at mid height.
Frequently asked questions
Why do the delays use negative values?
Negative delays start each bar partway through its bounce, so they are permanently out of phase with each other. Positive delays would just make some bars sit still before starting, which looks broken.
Can the bars react to real audio levels?
Not with this snippet; it is a decorative loop. For live levels, hook the Web Audio API analyser node to the bars and set each height from frequency data with JavaScript.
Is this animation performant?
Yes. animate-bounce only transforms translateY, which the browser can composite on the GPU. Five small bars like this cost essentially nothing.
How do I make the bars look like a real audio equalizer?
Vary the animation-duration and delay per bar with nth-child rules so each bar pulses on its own rhythm, which is what sells the equalizer illusion. Use a short bounce of 3px to full height with an ease-in-out alternate loop. If every bar shares the same timing, it reads as a metronome, not music.
How many bars should a wave loader have?
Five to nine bars is the sweet spot. Fewer than five looks sparse and the stagger has no rhythm to follow, more than nine turns into noise at small sizes. This element uses seven, which reads clearly even at favicon scale.
Can I pause the wave animation when it scrolls off screen?
Yes, use an IntersectionObserver to toggle animation-play-state between paused and running when the loader leaves the viewport. Infinite keyframe animations keep compositing even when invisible, so pausing saves battery on mobile. Add the same pause inside a prefers-reduced-motion block for users who ask for less motion.