motion-typewriter
Types out its text content character by character when it scrolls into view. Supports looping, a blinking cursor, and configurable timing.
Preview
Import
import 'motion-components/motion-typewriter' // just this one
import 'motion-components' // or the whole libraryUsage
<motion-typewriter interval="0.05" loop>
Hello, world.
</motion-typewriter>Properties
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
| | | number | 0.05 | Time between characters while typing, in seconds |
| | | number | 0 | Delay before typing starts after viewport entry, in seconds |
| | | number | 1.8 | Time to hold the finished line before erasing, in seconds (loop only) |
| | | boolean | false | Erase and retype continuously |
| | | number | 0.5 | With |
| | | boolean | false | With |
| | | boolean | true | Show a blinking cursor. Set |
Pause on hover
Add pause-on-hover to freeze the typing cycle while the pointer is over the text. gap
sets the empty pause between erasing and retyping.
<motion-typewriter interval="0.06" loop hold="1.2" gap="0.8" pause-on-hover>
Hover to hold the line
</motion-typewriter>JavaScript API
Control the typewriter programmatically with play(), pause(), finish(), and cancel().
Accessibility
Respects prefers-reduced-motion: when enabled, the typing animation is skipped, the full text appears immediately and loop never starts.