Text Animations

Stretch Type

Type that deforms with how fast you are scrolling rather than how far. Each glyph springs toward the same velocity signal on a softer spring than the one before it, so the wave down the word is a consequence of the physics instead of a list of delays — change the string and it re-tunes itself.

Install

bun add motion clsx tailwind-merge

Then copy 2 files into your project:

  • components/registry/stretch-type/stretch-type.tsx
  • lib/utils.ts

Props

PropTypeDefaultDescription
stretchnumber0.55How far the leading glyph deforms at full velocity. The opposite axis gives up two thirds of what this gains — a full reciprocal preserves the area exactly and reads as the letter being squeezed through a gap rather than pulled.
skewnumber12Degrees of lean at full velocity. Signed off the scroll direction, so scrolling back up leans the word the other way — this is what stops a fast reversal from looking like the same animation replayed.
trackingnumber0.12Extra letter-spacing at full velocity. Unsigned, because the word should open up in both directions — spacing that closed on an upward scroll would read as the type being compressed rather than stressed.
stiffnessnumber260Spring stiffness of the leading glyph; every other glyph is a fraction of it. Low values keep deforming after the scroll has stopped, which reads as the word still catching up.
dampingnumber22How fast a glyph settles back to its resting shape. Under about 12 the word rings after every scroll stop and the effect stops being about the scroll.
maxVelocitynumber1600Scroll speed that counts as full deformation. A real ceiling, not a scale factor — the mapping clamps, so one trackpad flick cannot tear the type apart on a scroll nobody meant to be dramatic.
staggernumber0.7How much softer the last glyph's spring is than the first. At 0 the word deforms as a single block; near the top the tail lags far enough to read as a wave travelling down the line.
direction"vertical" | "horizontal""vertical"Which axis grows under load. Vertical grows from the baseline, which is how a letterform under tension actually behaves; horizontal grows from the leading edge and reads more like smearing.

What It Demonstrates

Scroll-driven animation
An animation whose progress is tied directly to scroll position.
Velocity
How fast and in which direction an element is moving. A spring carries it into the next animation when interrupted, so a flicked element keeps its speed.
Squash & stretch
Deforming an element as it moves to convey weight, speed, and flexibility.
Spring
Motion driven by physics (tension, mass, damping) rather than a set duration.
Momentum
Motion that carries velocity, especially after a drag or interruption.
Skew
Slant an element along the X or Y axis, shearing it out of its rectangular shape.
Interruptible animation
An animation that can be smoothly redirected mid-flight instead of finishing first.

Related Components

Appears In