Daniel Petho

Letter 3D Swap

Text 1

About

A text component that rotates each letter in 3D on hover to reveal a second face, useful for animated headings and hero titles.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Letter 3D Swap to your project and fits it to your theme.

Code

How Letter 3D Swap is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import Letter3DSwap from "@/components/ui/letter-3d-swap";
import { useState } from "react";

export default function Preview() {
  const [debug, setDebug] = useState(false);

  return (
    <div className="relative w-dvw h-dvh flex flex-col items-center justify-center p-8 bg-white ">
      <div className="flex flex-col items-center max-w-2xl font-cotham">
        <Letter3DSwap
          mainClassName="text-7xl bg-white lowercase"
          frontFaceClassName={`bg-white ${debug ? "border" : ""} text-black`}
          secondFaceClassName={`bg-white ${debug ? "border" : ""} text-black`}
          rotateDirection="left"
          staggerDuration={0.03}
          staggerFrom="first"
          transition={{
            type: "spring",
            damping: 25,
            stiffness: debug ? 50 : 160,
          }}
        >
          SET YOUR MIND TO IT
        </Letter3DSwap>
      </div>
    </div>
  );
}

Dependencies

More by Daniel Petho

View all
  • Parallax Floating

    Parallax Floating

    2.2K
  • Text Rotate

    Text Rotate

    2.1K
  • Typewriter

    Typewriter

    1.9K
  • Marquee Along SVG Path

    Marquee Along SVG Path

    1.4K
  • Image Trail

    Image Trail

    1.4K
  • Animated Gradient With SVG

    Animated Gradient With SVG

    884
  • Text Cursor Proximity

    Text Cursor Proximity

    780
  • Pixel Trail

    Pixel Trail

    645

More in Text

View all
  • Vertical Cut Reveal Characters

    Vertical Cut Reveal Characters

    103
  • Rainbow Text Effect

    Rainbow Text Effect

    47
  • Text Loop

    Text Loop

    306
  • Motion Blur Text

    Motion Blur Text

    36
  • Text Reveal

    Text Reveal

    27
  • Apple Hello Effect

    Apple Hello Effect

    608
  • Lightning Text

    Lightning Text

    122
  • ParticleTextEffect

    ParticleTextEffect

    2.1K