Effects JS behaviour

Typewriter

Types phrases a grapheme at a time (a Persian letter keeps its marks and joiners), deletes only back to what the next phrase shares, and goes on. The caret blinks while a phrase holds.

Real scenarios

The component as it is used in a product — not a specimen grid.

Agency hero

Only the end of the line changes, so only the end is deleted and retyped. Persian types a grapheme at a time — letters with their half-spaces stay whole.

We build websites · We build mobile apps · We build brands · We build experiences

A studio of twelve in Istanbul and Berlin.

Assistant status

by="word" and :loop="false": the status types word by word and rests on its last phrase with a block caret.

Your draft reply is ready.

Important props

Important props
Prop Type Default What it does
phrases array [] The phrases, in order; screen readers get them once, as plain text.
by string 'grapheme' grapheme, or word to type whole words.
type-speed · delete-speed · hold int (ms) 55 · 28 · 1800 Time per typed and deleted piece, and the hold on a finished phrase.
loop bool true Cycle forever; false stops on the last phrase.
caret string 'bar' bar · block · none.

Snippet

<h1>
    ما
    <x-nx::typewriter :phrases="['وب‌سایت می‌سازیم', 'اپلیکیشن می‌سازیم', 'برند می‌سازیم']" />
</h1>
<p><x-nx::typewriter by="word" :loop="false" :phrases="['Thinking…', 'Drafting a reply…']" /></p>