Motion Blocks

Text

Stacking Words

Splits text into lines and slides each line's words in from the right on scroll. Framework-agnostic Custom Element.

  • lit Preview of https://lit.devLitSimple. Fast. Web Components.
  • gsap Preview of https://gsap.comGSAPAnimate anything. Silky-smooth performance.

Preview

↓ Scroll to reveal

Hell yeah!

Each line's words slide in from the right as you scroll. Scroll the preview below.
Attributes

Installation

pnpm dlx motion-blocks add stacking-words

Usage

---import "@/components/motion-blocks/stacking-words-element.ts";--- <motion-stacking-words  text="Every word arrives on its own."  start="top 90%"  end="top 30%"></motion-stacking-words>

API Reference

Attribute Type Default
text The text content to display and animate. string ""
start ScrollTrigger start position (when animation begins). string "top 90%"
end ScrollTrigger end position (when animation completes). string "top 30%"
scrub Scrub duration in seconds for smooth scroll linking. number 1.234
stagger Delay between each word's animation in seconds. number 0.21
ease easing function for the animation. string "power3.out"
scroll-element CSS selector for scrollable container (defaults to window). string ""