Skip to content
Onycx-ui
ESC

Scroll Word Highlight

Highlight a sentence word by word as the reader scrolls past it.

Dependencies
gsap
Size
214 lines
Controls
11 controls

Installation

CLI · shadcn registry

npx shadcn@latest add https://ui.onycx.dev/r/scroll-word-highlight.json

1 · Dependencies

npm install gsap

2 · Copy the source

components/onycx/scroll-word-highlight.tsx

Requires React 19 and Tailwind CSS v4. Copy the source from the scroll-word-highlight.tsx tab after tweaking: your values are baked in as the new defaults. Exported image examples use portable sample artwork. Replace it with your own media as needed.

Props

PropTypeDefaultDescription
textstring—Statement, split on spaces into words.
eyebrowstring"01 / The point of view"Label with a square accent point. Empty hides it.
showEmblem / emblemLabelboolean / stringtrue / "THINK / MAKE / MOVE"Gradient tile with the studio mark and a tiny caption (hidden under 600px).
notestring"One independent studio.\nA complete digital perspective."Note under the statement; "\n" breaks the line.
linkLabel / linkHrefstring"Get to know the studio" / "#"Underlined text link. Empty label hides it.
mode"color" | "opacity""color"Sweep colour dim → lit, or opacity 0.25 → 1.
dimColor / color / accent / mutedstring"#7e8795" / "#f0f1f4" / "#ff652e" / "#a6b0bd"Unread, read, accent point/link hover, and note colours.
start / endnumber65 / 65Sweep runs from the section top at start% to the section bottom at end% of the viewport.
scrub / staggernumber0.5 / 0.16Scroll smoothing in seconds and the per-word offset.
classNamestring—Extra classes on the section.