Free · MIT licence · No dependencies

Velocity Marquee Free React component

An endless ticker that reacts to the scroll: scroll down and it races forward and leans into the motion, scroll up and it flips direction, stop and it eases back to its resting speed. Works for text, logos or anything else.

  • React
  • CSS
  • Scroll
  • Ticker
  • Logos
Velocity Marquee

Get the code

Install in one linenpx shadcn@latest add https://alphenex.com/r/velocity-marquee.json

Works with any React project through the shadcn CLI. Prefer to paste it yourself? Copy the two files below into components/alphenex/. No Tailwind or animation library needed.

import VelocityMarquee from '@/components/alphenex/velocity-marquee';

<VelocityMarquee items={['Design', 'Build', 'Launch']} />

How the velocity marquee works

The items are rendered three times side by side. The track moves left a little on every animation frame, and when it has travelled the width of one copy it jumps back by exactly that width. The copies are identical, so the jump is invisible and the ticker never ends.

Scroll speed is read on every frame from the change in window.scrollY and smoothed, so the ticker accelerates and decelerates instead of jerking. The same value sets the lean with skewX, and the scroll direction decides which way the ticker runs.

The loop only runs while the marquee is on screen, and the two duplicate copies are hidden from screen readers so the items are announced once.

Frequently asked questions

Yes. Pass renderItem to draw anything for each item, for example an img tag for a client logo strip.

Want motion like this on your website?

We design and build custom websites with motion, 3D and SEO built in. Websites from $500.

More free components

Explore our work