Backgrounds

Barcode

A procedural barcode whose bars light up like piano notes — looping on autoplay or scrubbed by scroll.

Install

bun add gsap

Props

PropTypeDefaultDescription
mode"autoplay" | "scrub""autoplay"Autoplay loops the note timeline; scrub ties it to scroll position.
restOpacitynumber0.6Opacity a bar settles at after its note.
peakOpacitynumber1Opacity at the peak of a note strike.
noteDurationnumber1.6Length of one note's swell and fade.
speednumber1Playback rate of the autoplay loop.
colorstring (hex)"#a855f7"Bar color.

What It Demonstrates

Loop
An animation that repeats, a set number of times or infinitely.
Scroll-driven animation
An animation whose progress is tied directly to scroll position.
Stagger
Animate several items one after another with a small delay between each, creating a cascade.
Stepped animation
An animation that is divided into discrete steps, like a countdown timer.

Related Components

Appears In