Scroll Velocity Text

A direction-aware kinetic typography component that smoothly expands letter-spacing and scale on downward scroll, and winds back on upward scroll, with zero per-frame React re-renders.

Scroll the container down and up to observe kinetic velocity physics

BUILD THE FUTURE

Direction-aware letter-spacing expanding on downward momentum with zero per-frame React re-renders.

End of velocity track · Scroll back up to restore rest state

Installation

Add the component directly to your repository using shadcn CLI:

npx shadcn@latest add Surajmaurya1/easyui/scrollvelocitytext

API Reference

PropTypeDefaultDescription
textstringThe text string to render as a single accessible text node
askeyof JSX.IntrinsicElements'span'HTML tag to render as (e.g. "h1", "h2", "span", "p", "div")
expandDistancenumber500Net scroll distance in pixels needed to progress from resting size to fully expanded and faded out
intensitynumber1Multiplier on how much each scrolled pixel contributes to expansion progress
minLetterSpacingnumber0Letter-spacing in em units at rest (zero scroll progress)
maxLetterSpacingnumber1Letter-spacing in em units at full scroll expansion
maxScalenumber1.6Scale multiplier at full scroll expansion (1 = no scale change)
fadeStartnumber0.4Progress fraction (0–1) at which the text begins fading out (>= 1 disables fading)
smoothingMsnumber400Duration in milliseconds of the CSS easing transition between scroll updates
transformOriginstring'center center'CSS transform origin for expansion and scaling (e.g. "left center" for left-aligned headlines)
scrollContainerRefRefObject<HTMLElement | null>Optional ref to a custom scrollable container instead of the window viewport
classNamestringAdditional CSS classes for font size, weight, color, and positioning