Ravi Katiyar

Text Rotator

Text

About

Text Rotator Dynamic heading animation. Smoothly transitions between multiple words or phrases to grab attention and enhance hero sections. Ideal for landing pages and banners.

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

Code

How Text Rotator is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client"

import { TextRotator } from "@/components/ui/text-rotator"

export default function TextRotatorDemo() {
  const texts = [
    "Modern",
    "Responsive",
    "Accessible",
    "Beautiful",
    "Reusable",
    "Performant",
    "Type-Safe",
  ]

  // Advanced 3D Flip Animation
  const animation = {
    initial: { opacity: 0, rotateX: -90, y: 50 },
    animate: { opacity: 1, rotateX: 0, y: 0 },
    exit: { opacity: 0, rotateX: 90, y: -50 },
  }

  const transition = {
    type: "spring",
    stiffness: 300,
    damping: 25,
  }

  return (
    <div className="flex min-h-[400px] w-full flex-col items-center justify-center gap-8 bg-background p-4">
      <div className="text-center text-4xl font-bold tracking-tight text-foreground md:text-6xl">
        <span>Build it </span>
        <TextRotator
          texts={texts}
          rotationInterval={2500}
          // Animation Props
          initial={animation.initial}
          animate={animation.animate}
          exit={animation.exit}
          transition={transition}
          // Staggering
          staggerDuration={0.03}
          staggerFrom="first"
          // Styling & Layout
          splitBy="characters"
          mainClassName="text-primary"
          splitLevelClassName="overflow-hidden"
          elementLevelClassName="pb-1 pt-1" // Padding for 3D effect
        />
      </div>
    </div>
  )
}

Dependencies

More by Ravi Katiyar

View all
  • Animated Shader Hero

    Animated Shader Hero

    3.7K
  • Hero

    Hero

    3.1K
  • Circular Gallery

    Circular Gallery

    2.7K
  • Minimalist Hero

    Minimalist Hero

    2.5K
  • Floating Icons Hero Section

    Floating Icons Hero Section

    1.9K
  • Glass Calendar

    Glass Calendar

    1.8K
  • Feature Carousel

    Feature Carousel

    1.7K
  • AI Image Generator Hero

    AI Image Generator Hero

    1.4K

More in Text

View all
  • Vertical Cut Reveal Characters

    Vertical Cut Reveal Characters

    103
  • Motion Blur Text

    Motion Blur Text

    36
  • NeonRGBTextEffect

    NeonRGBTextEffect

    144
  • Text Reveal

    Text Reveal

    27
  • Random Letter Swap

    Random Letter Swap

    46
  • Rainbow Text Effect

    Rainbow Text Effect

    47
  • Text Color

    Text Color

    545
  • Blur Reveal

    Blur Reveal

    300