A typewriter effect reveals text one character at a time, often with a blinking caret, as if it were being typed in front of you.
A typewriter effect writes text out letter by letter. Search boxes use it to show a suggestion being filled in, chat and AI interfaces use it for answers arriving, and hero sections use it to cycle through phrases.
For a single line in a monospaced font, CSS can do it alone: animate the width from 0 to the text length in ch units with steps() so it grows one character at a time, and blink a caret with a border. For proportional fonts, wrapped text or several phrases, reveal characters with a little JavaScript instead.
Keep the whole text in the page from the start (screen readers and search engines read it straight away), do not type out anything people need to read quickly, and show the full text at once under reduced motion.
.type {
font-family: ui-monospace, monospace;
width: 22ch; /* the length of the text */
white-space: nowrap;
overflow: hidden;
border-right: 2px solid;
animation: typing 2.2s steps(22) both, caret 0.8s step-end infinite;
}
@keyframes typing { from { width: 0; } }
@keyframes caret { 50% { border-color: transparent; } }