Baktiyar Ablaikhan

Flip Words

Source
Aceternity UI ↗
Author
Aceternity UI
Licence
Aceternity UI licence (free component)

Loading…

One word in the sentence flips to the next with a letter-by-letter blur.

Code

"use client";
import React from "react";
import { FlipWords } from "@/lab/aceternity/ui/flip-words";
import { Fit } from "./_fit";

export default function FlipWordsDemo() {
  const words = ["better", "cute", "beautiful", "modern"];

  return (
    <Fit width={620} height={240} max={1.6}>
      <div className="h-full flex justify-center items-center px-4">
        <div className="text-4xl mx-auto font-normal text-neutral-600 dark:text-neutral-400">
          Build
          <FlipWords words={words} /> <br />
          websites with Aceternity UI
        </div>
      </div>
    </Fit>
  );
}
Prompt

Build "Flip Words", a text animation. What it does: One word in the sentence flips to the next with a letter-by-letter blur. Write it as a single self-contained React component in TypeScript that fills its parent (w-full h-full), styled with Tailwind CSS, using motion. Technique: the Motion library. It sits on a light background, in a 16:10 frame. Respect prefers-reduced-motion with a still state, pause work when the element is off screen, and keep it accessible. Original: https://ui.aceternity.com/components/flip-words (Aceternity UI, Aceternity UI licence (free component)).