cnippet/ui
  1. motion
  2. text animations
  3. typewriter

text animations

Typewriter

Characters appear one by one as if being typed, with an optional blinking cursor. Supports multi-string looping with delete animations.

Installation

Usage

Anatomy

Good to know

  • text can be one string or an array. With an array, it types each one in turn.
  • speed and deleteSpeed are milliseconds per character. waitTime is the pause before deleting.
  • loop (default true) repeats forever. Set loop={false} to stop after the last text.
  • Screen readers may read the text while it's half typed. Add an aria-label with the full text on a wrapper if that matters.
  • When the user has turned on reduced motion, each string appears whole instead of letter by letter, and the cursor does not blink. Multiple strings still cycle after waitTime.

Props

Examples

Hero Headline

Types a single string with loop={false} and a block-underscore cursor. The text resolves once and stays.

Looping Phrases

Cycles through an array of strings, deleting and retyping each. Embed inline in a heading for a classic hero pattern.

Terminal Prompt

Monospace font, dark background, and a block cursor create a CLI-style terminal animation. Use initialDelay to let the container render first.