Text Word Flip

Spring-loaded word flips paired with a soft letter-by-letter blur stagger.

textflipwordsblurstaggerheadlineanimationspring
Text Word Flip component preview

Overview

Text Word Flip is a React and Tailwind CSS word rotator that flips between words and phrases with a spring, in Next.js or any React app, built on Framer Motion. Incoming letters blur in one by one, words in a phrase stagger, and the outgoing word scales up and drifts off to the top right. Each new word is announced to screen readers, as sets the element, and reduced motion shows a static word. Like any rotator, only the visible word exists in the markup, so keep your key phrase in the words around it for search engines.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add text-word-flip

Usage

Import TextWordFlip from @/components/wensity/text-word-flip and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import { TextWordFlip } from "@/components/wensity/text-word-flip";
export default function Example() {
return (
<p className="font-display text-4xl font-semibold whitespace-nowrap">
Build{" "}
<TextWordFlip
words={["clean", "crisp", "sharp", "sleek"]}
className="text-chili-500"
/>{" "}
apps with wensity
</p>
);
}

Props

PropTypeDefaultDescription
wordsstring[]["clean","crisp","sharp","sleek"]Words or phrases to cycle through.
durationnumber1700Hold time per word before flipping, in milliseconds.
letterDelaynumber0.05Stagger delay between letters, in seconds.
wordDelaynumber0.3Stagger delay between words inside a phrase, in seconds.
pausedbooleanfalsePause the cycle on the current word.
as"p" | "span" | "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6""span"Element to render. Pass a heading tag when the rotating word is the whole headline.

Featured in React hero section components.