Skip to content

Typewriter

Types, makes a mistake, deletes and retypes. Or cycles phrases, like a prompt placeholder.

On this page

Examples

Installation

npx knowns-ui@latest add typewriter
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

script
(string | { back } | { pause } | { clear })[]
Type, delete n characters, wait, or clear. Mistakes and fixes read as human.
phrases
string[]
Or type each phrase, hold, delete, next. Loops by default (a prompt placeholder).
typeSpeed / deleteSpeed
number (ms)
Default55 / 28
Per character, with jitter and a beat after spaces and punctuation.
hold
number (ms)
Default1600
How long a finished phrase stays.
loop
boolean
Defaultphrases: true
Start again at the end.
caret
boolean
Defaulttrue
Solid while typing, blinking at rest.
startComplete
boolean
Defaultfalse
Start on the finished text (the first phrase, or the script's end), then play. For posters and previews.
label
string
Defaultthe final text
What screen readers hear.
Accessibility
-
Screen readers get the full text once; the animated layer is aria-hidden. prefers-reduced-motion shows the final text. Pauses offscreen, in hidden tabs and on paused.

When to use

When to use

  • Hero lines that type, correct themselves and retype, or cycle through example prompts.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Typewriter to my app and wire it to my own data.
  • I need hero lines that type, correct themselves and retype, or cycle through example prompts. Set that up with the Knowns UI Typewriter.
  • Which Typewriter props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "typewriter" }) and search_docs({ query: "typewriter" }).

Need help?

Stuck on Typewriter, or found something off? We read every message.