Springy Text

Springy Text

Words fall into place with individual spring physics on scroll enter, drop away downward on exit.

Installation

▸ Run the following command

npx shadcn@latest add https://www.mellowui.com/r/springy-text.json

▸ Or install manually

  1. Install dependencies: pnpm add motion
  2. Copy the source from the Code tab above.
  3. Place it at components/mellow/springy-text.tsx
  4. Import and use.

API Reference

PropTypeDefaultDescription
textstringThe text to animate.
as"h1" | "h2" | "h3" | "h4" | "p""h2"Element type used for the wrapper.
wordClassNamestringClass name applied to each word wrapper.
letterClassNamestringClass name applied to each letter wrapper.
staggerDelaynumber15Stagger delay between letters in milliseconds.
enterFrom"top" | "bottom""top"Direction letters enter from.
exitTo"bottom" | "top""bottom"Direction letters exit to.
oncebooleanfalseIf true, entrance animation only runs once.
thresholdnumber0.3Viewport threshold for triggering in-view animation.
classNamestringAdditional CSS classes applied to the wrapper element.