Scroll Words

A paragraph that lights up word by word as you scroll through it.

gsapMIT · free

Scroll inside this box ↓

Good motion doesn't shout. It guides the eye, explains what changed, and then gets out of the way, like a wave that carries you to shore.

Installation

npx shadcn@latest add https://ombakui.com/r/scroll-words.json

Usage

import { ScrollWords } from "@/components/scroll-words";

<ScrollWords className="text-4xl font-semibold" text="Good motion doesn't shout. It guides the eye…" />

Props

PropTypeDefaultDescription
text*string–The paragraph. Plain text.
asElementType"p"HTML tag to render.
dimnumber0.18Opacity of words that haven't been "read" yet.
startstring"top 80%"ScrollTrigger start.
endstring"bottom 40%"ScrollTrigger end.
scrollerReact.RefObject<HTMLElement | null>–Use a scrollable element instead of the window, e.g. for demos.
classNamestring–