text animations
Scroll Swap Text
Text slides in from below as its scrollable container is navigated — the current copy exits upward while a clone rises into place, creating a smooth reveal tied directly to scroll position.
Installation
Usage
Anatomy
Good to know
containerRefis required. Pass a ref to the element that scrolls, not to the page.childrenshould be plain text.offsetsets which part of the scroll range drives the swap (MotionuseScrolloffsets).- When the user has turned on reduced motion, the swap follows the scroll position directly, without the spring.
Props
Examples
Feature List
A scrollable feature list where each item slides in as you scroll. Pass the same containerRef to every ScrollSwapText so they all track the same scroll container.
Step-by-Step Process
Numbered steps in a compact scroll container — each label swaps in as it crosses the scroll threshold.
Testimonial Quotes
Pull quotes scroll into view one at a time. The consistent swap motion creates a unified rhythm across all items.