Layout Text Flip
- Source
- Aceternity UI ↗
- Author
- Aceternity UI
- Licence
- Aceternity UI licence (free component)
Loading…
The word in the chip flips through a list with a blur, and the layout resizes smoothly to fit it.
Code
"use client";
import { LayoutTextFlip } from "@/lab/aceternity/ui/layout-text-flip";
import { motion } from "motion/react";
export default function LayoutTextFlipDemo() {
return (
<div className="@container relative flex h-full w-full flex-col items-center justify-center px-6">
<motion.div className="relative mx-4 my-4 flex flex-col items-center justify-center gap-4 text-center @xl:mx-0 @xl:mb-0 @xl:flex-row">
<LayoutTextFlip
text="Welcome to "
words={["Aceternity UI", "Fight Club", "The Matrix", "The Jungle"]}
/>
</motion.div>
<p className="mt-4 max-w-md text-center text-sm @xl:text-base text-neutral-600 dark:text-neutral-400">
Experience the power of modern UI components that bring your ideas to
life.
</p>
</div>
);
}
Prompt
Build "Layout Text Flip", a text animation. What it does: The word in the chip flips through a list with a blur, and the layout resizes smoothly to fit it. 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/layout-text-flip (Aceternity UI, Aceternity UI licence (free component)).