Toggle Sidebar B
AppearanceLight & dark mode D

Scroll Velocity

Text marquee animation where speed and distortion scale with the user's scroll velocity.

Default

Scroll the page to speed the rows up. Every prop is wired to the controls underneath.

Light previewReplay previewOpen in new tab
UI Library UI Library UI Library UI Library UI Library UI Library 
Scroll Down Scroll Down Scroll Down Scroll Down Scroll Down Scroll Down 

Customize

Velocity100
Num Copies6
Damping50
Stiffness400

API Reference

ScrollVelocity

PropTypeDefaultDescription
scrollContainerRefRef<HTMLElement>undefinedOptional ref for a custom scroll container to track scroll position.
textsstring[][]Array of strings to display as scrolling rows.
velocitynumber100Base velocity for scrolling; sign is flipped for odd indexed texts.
classNamestring""CSS class applied to each text copy (span).
dampingnumber50Damping value for the spring animation.
stiffnessnumber400Stiffness value for the spring animation.
numCopiesnumber6Number of copies of the text rendered for a continuous scrolling effect.
velocityMapping{ input: number[]; output: number[] }{ input: [0, 1000], output: [0, 5] }Mapping from scroll velocity to a movement multiplier for dynamic scrolling.
parallaxClassNamestring"parallax"CSS class for the parallax container.
scrollerClassNamestring"scroller"CSS class for the scroller container.
parallaxStyleCSSPropertiesundefinedInline styles for the parallax container.
scrollerStyleCSSPropertiesundefinedInline styles for the scroller container.

Accessibility

Keyboard shortcuts and ARIA behavior.

  • The text is repeated numCopies times, so screen readers read it several times. Mark the row aria-hidden and give the section a label if that is noisy.
  • The marquee moves continuously. Provide a way to stop it for users who prefer reduced motion.