Typewriter
Enable
Typing and deleting animation that cycles through a list of strings. Includes a blinking cursor.
functions.php
JS module
main.scss
SCSS import
Basic Usage
Add data-typewriter with pipe-separated strings. The element types each string, pauses, deletes, then moves to the next.
data-typewriter
We build
Options
Control speed, pause duration, and looping via data attributes.
data-typewriter-*
Attribute Default Description
data-typewriter — Pipe-separated strings to cycle through
data-typewriter-speed 80 Typing speed in ms per character
data-typewriter-delete-speed 40 Deleting speed in ms per character
data-typewriter-pause 1500 Pause in ms after typing a string
data-typewriter-loop true Loop back to first string after last
Speed Variations
Compare different speed settings.
Fast
speed: 40, pause: 800
Slow
speed: 150, pause: 2000
Cursor
A blinking .typewriter-cursor is automatically appended after the element. Styled via CSS keyframes.
.typewriter-cursor
Accessibility
Respects prefers-reduced-motion.
prefers-reduced-motion
When reduced motion is enabled, the first string is displayed immediately with no animation. The cursor blink animation is also disabled.
On this page