Platform
VaultVault
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
ButtonsPart of ProButtons
IconsPart of ProIcons
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
SavedPart of ProSaved
Support
DocumentationDocumentation
MCP serverMCP server
SettingsSettings
VaultTextLooping Typewriter
Torn Paper SwapBrowse all 182Draw-In Underline Link
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
Sign inSign in

Start free. The code for 15 components, no card needed.

Get 15 free

Looping Typewriter

This one is locked. Become a member to open the code for it and the rest of the Vault.

See plansTry the 15 free ones

What you'll need.

Install

  • gsap

Setup

npm i gsap

More like this

  • Hero
  • Infinite loop

Features.

  • Types a list of phrases one letter at a time, holds each, deletes it and moves on to the next, forever
  • A human rhythm: every letter waits the type speed × a random 0.5–1.5
  • Deletes at a steady pace, faster than it types
  • A thin caret in the accent colour blinks after the text on a 1s step
  • Two lines of height are reserved, so a phrase that wraps never pushes the page around
  • Put \n in a phrase for a deliberate line break
  • Screen readers get every phrase once, as plain text, instead of a stream of letters
  • Runs on GSAP's ticker, so the loop pauses while the tab is hidden
  • Respects prefers-reduced-motion: the last phrase is shown complete and the caret holds still
  • GSAP only, plain CSS for the look

How to get it right.

Write phrases that finish the lead

The lead stays put and each phrase completes it: "Mars has" → "two tiny, lumpy moons." Read every phrase with the lead out loud; if one doesn't make a sentence, rewrite it.

Keep them to two lines

The line reserves two lines of height (min-height: 2.5em). A phrase that wraps to three grows the hero while it types. Shorten it, or use \n to break it where you want.

Three to five phrases

Each one takes a few seconds to type, hold and delete. Past five, readers won't wait for the loop to come round.

Let it hold

data-au-hold is how long a finished phrase stays. 1.8s is enough to read a short line; raise it for longer phrases.

Variations.

  • Default — data-au-type-speed="0.07", data-au-delete-speed="0.04", data-au-hold="1.8"
  • Brisk — data-au-type-speed="0.04" and data-au-hold="1.2"
  • Thoughtful — data-au-type-speed="0.12" and data-au-hold="3"
  • No lead — remove the [data-twr-lead] span and write full sentences as phrases
  • Your colours — override --twr-accent for the caret and eyebrow, plus --twr-bg, --twr-fg, --twr-muted, --twr-button, --twr-button-text and --twr-surface

Where it fits.

  • Hero headlines — one promise, several endings
  • Product pages — "Built for…" followed by the people it's for
  • Portfolio intros — "I design…" with the things you do
  • Empty states and search — rotating example queries

Frequently asked.

Edit the JSON array in data-au-phrases. Keep it valid JSON: double quotes inside, single quotes round the attribute.

Yes. It ships without them. .twr_eyebrow goes above the title; .twr_sub and a .twr_actions row of .twr_button links go below it. They're styled and need no script. Only the typed span ([data-twr-text]) and the phrases are required.

The animated line is aria-hidden. A visually hidden span ([data-twr-sr]) holds the lead plus every phrase, so they're read once.

Set font-size on .twr_line for the typed text, or on .twr_hero to scale everything. All sizes are in em.

Each [data-au-typewriter] runs its own loop.

Related components.

Pro

Multi-Cursor Typing

Load

Pro

Scroll-Lit Word List

Scroll

Pro

Glitch Wipe Reveal

Scroll