cnippet/ui
  1. motion
  2. text animations
  3. rotating text

text animations

Rotating Text

A single-slot word rotator — one string at a time slides in and out vertically on a configurable interval. Drop it inline in a heading to cycle through key phrases.

Installation

Usage

Anatomy

Good to know

  • It cycles through words forever. interval is in milliseconds (default 2500).
  • direction is "up" or "down".
  • Screen readers only hear the word that's showing when they reach it.
  • For more control (letter staggering, manual next/previous), use TextRotate.
  • When the user has turned on reduced motion, the words still change on the timer but swap instantly, with no slide.

Props

Examples

Hero Inline

Adjectives rotate inline in a heading. The slot width is set by the longest word so surrounding text stays stable.

Framed CTA

Action phrases rotate inside a bordered card, making static supporting copy feel dynamic without changing the layout.

Testimonial Audience

direction="down" (words enter from above) inside a pull-quote cycles the target audience descriptor.