Typewriter
Types, holds and deletes through a list of words.
- 1.3 KB gzipped
- Deps: motion/react
- Reduced-motion safe
- Base UI & Radix compatible
Preview
Build it faster., smoother., free.
Installation
pnpm dlx shadcn@latest add https://paulkeys.org/r/typewriter.jsonAdds components/velora/typewriter.tsx, installs motion.
Props
| Prop | Type | Default |
|---|---|---|
words* | string[] | — |
typeSpeedms per typed character | number | 70 |
deleteSpeedms per deleted character | number | 40 |
holdTimems to hold a completed word | number | 1800 |
loop | boolean | true |
cursor | boolean | true |
Also accepts every <span> attribute, forwarded to the root element.
Accessibility
- Reduced motion
- The first word shows as static text with no typing, deleting or cursor. With motion allowed, typing pauses while the pointer is over the text or focus is inside it.
- Keyboard
- Decorative — nothing to operate.
- Screen readers
- All words are exposed once, comma-separated, in an sr-only span; the typed text and cursor are aria-hidden.