Daniel Petho

Letter 3D Swap

Text 2

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.3K
  • Text Rotate

    Text Rotate

    2.1K
  • Typewriter

    Typewriter

    1.9K
  • Marquee Along SVG Path

    Marquee Along SVG Path

    1.5K
  • Image Trail

    Image Trail

    1.4K
  • Animated Gradient With SVG

    Animated Gradient With SVG

    902
  • Text Cursor Proximity

    Text Cursor Proximity

    800
  • Pixel Trail

    Pixel Trail

    656

More in Text

View all
  • Astryx Chat Tokenized Text

    Astryx Chat Tokenized Text

    8
  • Rainbow Text Effect

    Rainbow Text Effect

    60
  • Scroll Fill Headline

    Scroll Fill Headline

    39
  • Vertical Cut Reveal Characters

    Vertical Cut Reveal Characters

    134
  • Apple Hello Effect

    Apple Hello Effect

    672
  • Blur Reveal

    Blur Reveal

    375
  • NeonRGBTextEffect

    NeonRGBTextEffect

    155
  • Text Reveal

    Text Reveal

    31