Text 3D Flip
- Source
- Magic UI ↗
- Author
- Magic UI
- Licence
- MIT
Loading…
Hover the line and each letter flips over like a cube, staggered.
Code
"use client";
import Text3DFlip from "@/lab/magicui/ui/text-3d-flip";
export default function Text3DFlipDemo() {
return (
<div className="@container relative flex h-full w-full items-center justify-center px-6">
<Text3DFlip
className="justify-center bg-white text-center font-serif text-[clamp(1.75rem,6cqw,3.5rem)]"
textClassName="bg-white text-neutral-950"
flipTextClassName="bg-white text-neutral-950"
rotateDirection="top"
staggerDuration={0.03}
staggerFrom="first"
transition={{ type: "spring", damping: 25, stiffness: 160 }}
>
Stay hungry, stay foolish
</Text3DFlip>
</div>
);
}
Prompt
Build "Text 3D Flip", a text animation. What it does: Hover the line and each letter flips over like a cube, staggered. 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://magicui.design/docs/components/text-3d-flip (Magic UI, MIT).