Text Animations
Marquee Velocity
A wrapping marquee whose drift speed and direction follow scroll velocity — fast scrolls whip the row along, upward scrolls reverse it.
Install
bun add motion clsx tailwind-mergeThen copy 2 files into your project:
- components/registry/marquee-velocity/marquee-velocity.tsx
- lib/utils.ts
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| velocity | number | 50 | Resting drift before scroll multiplies it. Positive moves the row right, negative moves it left, 0 leaves it still until you scroll. |
| damping | number | 50 | Friction on the velocity spring. Low overshoots and rebounds once the scroll stops; high settles dead. |
| stiffness | number | 400 | How hard the spring chases the current scroll speed. High tracks it instantly; low lags and keeps coasting, which reads as weight. |
| numCopies | number | 6 | Minimum copies tiled into the loop. A floor, not a count — narrow content gets more so the wrap never sweeps a gap through. |
What It Demonstrates
- Marquee
- Text or content that scrolls continuously in a loop.
- 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.
- Spring
- Motion driven by physics (tension, mass, damping) rather than a set duration.
- Momentum
- Motion that carries velocity, especially after a drag or interruption.
Related Components
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.
Marquee Text
A marquee that scrolls only when its text overflows the container.
Lumen
Copy that lights up as you read it. Words ahead sit dim and unfocused, and stay lit once you pass them.
Word Reveal
A scroll-scrubbed word reveal — each word brightens and rises as it enters the viewport, tied directly to scroll position.
Kinetic
Type with mass: every glyph is its own spring, and the squash and stretch are read back off that spring rather than authored.
Reel
A sentence with one slot that keeps changing. The words sit on a drum. The next word rolls up from below while the old one rolls away over the top, as a whole word or letter by letter. The slot's width springs to fit each new word, so the rest of the sentence is pushed along and does not jump. A screen reader gets every word once, as a list.