Text Animations

Marquee Velocity

A wrapping marquee whose drift speed and direction follow scroll velocity — fast scrolls whip the row along, upward scrolls reverse it.

Install

bun add motion clsx tailwind-merge

Then copy 2 files into your project:

  • components/registry/marquee-velocity/marquee-velocity.tsx
  • lib/utils.ts

Props

PropTypeDefaultDescription
velocitynumber50Resting drift before scroll multiplies it. Positive moves the row right, negative moves it left, 0 leaves it still until you scroll.
dampingnumber50Friction on the velocity spring. Low overshoots and rebounds once the scroll stops; high settles dead.
stiffnessnumber400How hard the spring chases the current scroll speed. High tracks it instantly; low lags and keeps coasting, which reads as weight.
numCopiesnumber6Minimum copies tiled into the loop. A floor, not a count — narrow content gets more so the wrap never sweeps a gap through.

What It Demonstrates

Marquee
Text or content that scrolls continuously in a loop.
Scroll-driven animation
An animation whose progress is tied directly to scroll position.
Velocity
How fast and in which direction an element is moving. A spring carries it into the next animation when interrupted, so a flicked element keeps its speed.
Spring
Motion driven by physics (tension, mass, damping) rather than a set duration.
Momentum
Motion that carries velocity, especially after a drag or interruption.

Related Components

Appears In