Components

Word Rotate

A rotating word animation for React and Tailwind CSS: words swap with a vertical slide and blur while the container's width springs between them, so the sentence around it glides instead of jumping. Every word stays readable by search engines and screen readers.

  • SEO-friendly real text
  • Springy width
  • AnimatePresence popLayout
  • Pause on hover
  • prefers-reduced-motion

Interfaces for founders, developers, designers, night owls

Installation

$ npx shadcn@latest add https://duskui.com/r/word-rotate.json

Usage

tagline.tsx
import { WordRotate } from "@/components/dusk/text/word-rotate"

export function Tagline() {
  return (
    <h1 className="text-5xl font-bold">
      Made for{" "}
      <WordRotate
        words={["builders", "designers", "teams"]}
      />
    </h1>
  )
}

Examples

Motion & styling

distance sets the slide (0 for a pure blur swap), blur the blur radius and interval how long each word stays. Style the words with wordClassName.

Pure blur swap, fade, melt

Make it clear, quiet, fast, yours

Slow, Steady, Smooth and calm.

Announced updates

For live status text, announce="polite" turns the word into a polite live region so screen readers announce each change instead of hearing the whole list once.

Edge cache warm in Frankfurt

API Reference

Also accepts any HTML attribute for the rendered element.

PropTypeDefaultDescription
wordsstring[]—Words or short phrases to cycle through. The first is server-rendered.
intervalnumber2400Milliseconds each word stays on screen (minimum 1000).
as"span" | "strong" | "em" | "p" | "div" | "h1" … "h6""span"Element to render.
distancenumber0.6Slide distance as a fraction of the word height. 0 for blur/fade only.
blurnumber4Blur of incoming and outgoing words, in px.
pauseOnHoverbooleantruePause the rotation while the pointer is over it.
announce"all" | "polite""all"all exposes every word once as hidden text; polite announces each change.
wordClassNamestring—Classes for each word, e.g. a color.

Accessibility

  • By default every word is in the DOM once as visually hidden text and the animated copy is aria-hidden, so screen readers read the full sentence and crawlers index all words.
  • With announce="polite" the visible word is a polite live region instead, for content that is genuinely live.
  • Rotation pauses off-screen, in hidden tabs and on hover, which also gives readers time with a word.
  • Width changes are animated, so surrounding text moves smoothly instead of jumping.
  • With prefers-reduced-motion the first word stays put and nothing rotates.