UniqueUI

Typewriter Text

Character-by-character typing with blinking cursor, configurable speed, and delete-retype loop.

npx uniqueui add typewriter-text

Preview

I love

Usage

import { TypewriterText } from "@/components/ui/typewriter-text";

export default function Example() {
  return (
    <div className="space-y-6 text-center p-10">
      <div className="text-3xl font-bold text-white">
        I love{" "}
        <TypewriterText
          words={["React", "TypeScript", "Motion", "Tailwind", "UniqueUI"]}
          className="text-purple-400"
          typingSpeed={100}
          deletingSpeed={60}
        />
      </div>
      <div className="text-lg text-neutral-400">
        <TypewriterText
          words={[
            "Building amazing user interfaces...",
            "With beautiful animations...",
            "That stand out from the crowd.",
          ]}
          typingSpeed={50}
          deletingSpeed={30}
          delayBetweenWords={2000}
        />
      </div>
    </div>
  );
}

Props

PropTypeDescription
theme"light" | "dark"Visual theme; light or dark. Default: dark.
wordsstring[]An array of words or phrases to be typed out sequentially.
classNamestringAdd CSS classes to the text container.
cursorClassNamestringAdd CSS classes to customize the blinking cursor span.
typingSpeednumberDelay in milliseconds between typing each character.
deletingSpeednumberDelay in milliseconds between deleting each character.
delayBetweenWordsnumberPause duration before erasing a completed word to type the next.
loopbooleanWhether the typewriter sequence should repeat infinitely.
cursorbooleanControls the visibility of the blinking cursor at the end of the text.