Rotating Words Headline
Original · freeA headline whose final word flips through a curated set with a blurred vertical roll while the rest of the line stays perfectly still.
Copy prompt gives Claude Code, Cursor or v0 a ready-to-paste prompt that recreates this exact component.
npx shadcn@latest add https://webinnoventix.com/r/text-rotating-words.json"use client";
import { useEffect, useState } from "react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
const words = ["bolder", "faster", "smarter", "kinder", "brighter"];
export default function TextRotatingWords() {
const reduce = useReducedMotion();
const [index, setIndex] = useState(0);
useEffect(() => {
const id = setInterval(() => {
setIndex((i) => (i + 1) % words.length);
}, 2200);
return () => clearInterval(id);
}, []);
const enter = reduce
? { opacity: 0 }
: { opacity: 0, y: "100%", filter: "blur(8px)" };
const exit = reduce
? { opacity: 0 }
: { opacity: 0, y: "-100%", filter: "blur(8px)" };
return (
<section className="relative flex min-h-[80vh] items-center justify-center overflow-hidden bg-zinc-50 px-6 py-24 dark:bg-zinc-950">
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10 [background-image:radial-gradient(circle_at_50%_35%,rgba(139,92,246,0.12),transparent_55%)]"
/>
<motion.div
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, amount: 0.5 }}
transition={{ duration: 0.6, ease: "easeOut" }}
className="mx-auto max-w-3xl text-center"
>
<span className="inline-flex items-center gap-2 rounded-full border border-zinc-200 bg-white/70 px-4 py-1.5 text-sm font-medium text-zinc-600 shadow-sm backdrop-blur dark:border-zinc-800 dark:bg-zinc-900/70 dark:text-zinc-300">
<span className="h-2 w-2 rounded-full bg-violet-500" />
Rotating words
</span>
<h2 className="mt-8 text-4xl font-bold tracking-tight text-zinc-900 sm:text-6xl lg:text-7xl dark:text-white">
Build something
<span className="relative mx-auto mt-2 flex h-[1.15em] items-center justify-center overflow-hidden">
<AnimatePresence mode="wait" initial={false}>
<motion.span
key={words[index]}
initial={enter}
animate={{ opacity: 1, y: "0%", filter: "blur(0px)" }}
exit={exit}
transition={{ duration: 0.5, ease: "easeOut" }}
className="absolute bg-gradient-to-r from-indigo-500 via-violet-500 to-fuchsia-500 bg-clip-text text-transparent dark:from-indigo-400 dark:via-violet-400 dark:to-fuchsia-400"
>
{words[index]}
</motion.span>
</AnimatePresence>
<span className="invisible" aria-hidden="true">
{words.reduce((a, b) => (a.length > b.length ? a : b))}
</span>
</span>
</h2>
<p className="sr-only" aria-live="polite">
Build something {words[index]}
</p>
<p className="mx-auto mt-6 max-w-xl text-lg leading-relaxed text-zinc-600 dark:text-zinc-400">
One headline, endless personalities. The final word flips through a
curated set while the rest of the line stays perfectly still.
</p>
<div className="mt-8 flex items-center justify-center gap-2" aria-hidden="true">
{words.map((w, i) => (
<span
key={w}
className={`h-1.5 rounded-full transition-all duration-300 ${
i === index
? "w-6 bg-violet-500"
: "w-1.5 bg-zinc-300 dark:bg-zinc-700"
}`}
/>
))}
</div>
</motion.div>
</section>
);
}Dependencies
Licence
Built by Web Innoventix. Free for personal and commercial use, no attribution required.
Built by Web Innoventix
Need a custom interface, a full website, or SEO that gets you cited by AI? We design, build and rank it end to end.
Get a free quoteSimilar components
Browse all →
Aurora Gradient Headline
OriginalAn animated headline whose living multi-colour gradient drifts across every letter while the words blur and stagger into place on scroll.

Character Reveal Heading
OriginalA cinematic heading that blurs and lifts in one character at a time with a staggered, scroll-triggered reveal.

Shimmer Sweep Headline
OriginalA headline with a polished light sheen that glides endlessly across the letters and races faster on hover.

Spotlight Hero
OriginalA centred hero with a soft radial spotlight, badge and dual call-to-action.

Split Hero
OriginalA two-column hero pairing a headline and CTAs with a product mock and social proof.

Gradient Spotlight Hero
OriginalA minimal centred hero with a soft gradient-mesh backdrop, announcement pill and dual call-to-action buttons.

App Preview Hero
OriginalA centred hero that pairs headline copy with a realistic product dashboard mock built entirely from markup, complete with browser chrome and a floating notification card.

Waitlist Capture Hero
OriginalA dark, focused hero with an inline email capture form and avatar social proof, ready for pre-launch waitlists.

Image Backdrop Hero
OriginalA cinematic full-bleed hero with a layered image-style backdrop, overlaid left-aligned copy and a trusted-by logos strip.

Gradient Mesh Hero with Staggered Text Reveal
OriginalA full-screen hero pairing a drifting animated gradient-mesh backdrop with a word-by-word staggered blur-in headline and a logo marquee under the fold.

Typewriter Rotating Words Hero
OriginalA hero whose headline cycles through rotating words with a live typewriter caret over an animated grid backdrop, degrading to a gentle word swap when reduced motion is on.

Floating UI Cards Hero with Mouse Parallax
OriginalA hero with glassy floating UI cards that drift continuously and shift on mouse-parallax depth around a staggered centre headline.

