Components

Flip Words

A flip words animation for React and Tailwind CSS: one word in a sentence flips over in 3D to the next on a timer, its letters flipping up one after another while the width springs smoothly between words. It pauses on hover and focus, and every word stays available to screen readers and search engines.

  • 3D rotateX flip
  • Letter stagger
  • Width spring
  • Pauses on hover / focus
  • prefers-reduced-motion

Build faster, calmer, accessible, delightful
interfaces with DuskUI

Installation

$ npx shadcn@latest add https://duskui.com/r/flip-words.json

Usage

tagline.tsx
import { FlipWords } from "@/components/dusk/flip-words/flip-words"

export function Tagline() {
  return (
    <h1 className="text-5xl font-bold">
      Ship <FlipWords words={["faster", "calmer", "together"]} className="text-muted-foreground" />
    </h1>
  )
}

Examples

Styles and timing

Style the word with className; the flip runs inside it. Set the pace with interval and the letter cascade with letterStagger.

Made for designers, builders, small teams

Deploy to edge, staging, production

Inside a paragraph

Words of very different lengths are fine: the surrounding sentence glides as the width springs. Hover or focus pauses it (pauseOnHover).

The sentence around the word glides as the width springs from short, much, much longer, medium and back. Hover it to pause.

API Reference

Also accepts any HTML attribute for the rendered element.

PropTypeDefaultDescription
wordsstring[]—Words or short phrases to flip through. The first is server-rendered.
intervalnumber3000Milliseconds each word stays before flipping (minimum 1200).
as"span" | "strong" | "em" | "p" | "div" | "h1" … "h6""span"Element to render. span sits inline in a sentence.
letterStaggernumber0.035Seconds between letters of the incoming word.
pauseOnHoverbooleantruePause while the pointer is over the word or focus is inside it.
wordClassNamestring—Classes for each word.

Accessibility

  • Every word is exposed once as visually hidden text, so screen readers and crawlers get the full list instead of a word that keeps changing; the animated copy is aria-hidden.
  • The first word is server-rendered with no entrance animation, so there's no flash or hydration mismatch.
  • The rotation pauses on hover and focus, while off-screen and in hidden tabs.
  • With prefers-reduced-motion it doesn't rotate at all: the first word stays put.