cnippet/ui
  1. motion
  2. text animations
  3. scroll swap text

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

  • containerRef is required. Pass a ref to the element that scrolls, not to the page.
  • children should be plain text.
  • offset sets which part of the scroll range drives the swap (Motion useScroll offsets).
  • 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.