Scroll Velocity Text
A marquee line that speeds up and leans with how fast the page scrolls.
Overview
Scroll Velocity Text drifts one or more rows of large text sideways, alternating direction from row to row. When the page scrolls the rows speed up and lean into the scroll, then ease back to their resting pace. Use it as a section divider or a closing line on a marketing page, where the words are a flourish rather than information.
Each row repeats as many times as it needs to fill its width, so the loop never shows a gap at any size.
Installation
Usage
import { ScrollVelocityText } from "@/components/animated/scroll-velocity-text"
<ScrollVelocityText rows={["Design with intent", "Ship with care"]} />The rows follow the nearest scrolling ancestor, or the page when there is none. Pass scrollContainer to choose the element yourself:
const panelRef = useRef<HTMLDivElement>(null)
<div ref={panelRef} className="h-96 overflow-y-auto">
<ScrollVelocityText scrollContainer={panelRef} rows={["Now showing"]} />
…
</div>Accessibility
Screen readers get each row once, in order, from a visually hidden copy. The moving copies are hidden from them, so the repeats are never read out.
The rows stop while they are offscreen. With reduced motion enabled they stay still and upright, one copy per row; scrolling has no effect. Set pauseOnHover to hold the rows while the pointer is over them.