Skip to content

Typewriter Text

A crisp typing loop with a steady, blinking cursor.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import TypewriterText from "./TypewriterText";
export default function Example() {
return (
<TypewriterText
phrases={[
"something different.",
"a little unexpected.",
"your next idea."
]}
prefix={"Build "}
typingSpeed={85}
deletingSpeed={35}
pause={1600}
loop={true}
cursorColor={"#cdb5eb"}
style={{
"fontSize": 38,
"letterSpacing": "-.045em",
"fontWeight": 500
}}
/>
);
}

Using Typewriter Text

Supply the sequence through phrases and optional fixed introductory copy through prefix.

typingSpeed, deletingSpeed, and pause control the pacing. Set loop according to whether the sequence should repeat or finish on its final phrase.

Props

NameTypeRequiredDefaultDescription
phrasesstring[]No[]Array of phrases to type in sequence. Empty arrays display no text.
typingSpeednumberNo80Milliseconds between typed characters.
deletingSpeednumberNo40Milliseconds between deleted characters.
pausenumberNo1400Pause after completing a phrase, in milliseconds.
loopbooleanNotrueRepeat the sequence. When false, stop at the final phrase.
cursorColorstringNo"#cdb5eb"Cursor colour. Reduced-motion users see a static phrase and cursor.
prefixstringNo""Optional static text before the typed phrase.
classNamestringNo""Additional CSS classes, merged with the component styles.
styleCSSPropertiesNoundefinedInline styles for caller-defined sizing and visual overrides.

Related components

Reflection Text

Text Effects

Crisp typography meets a soft, fading reflection beneath the baseline.

Morphing Words

Text Effects

Words dissolve through a soft blur while the headline keeps its width.

Dot Matrix Text

Text Effects

Amber pinpoints form a crisp matrix display with a soft travelling pulse.

Scan Text

Text Effects

A warm scanning light brings a dim headline into focus.