StreamingText

Typewriter animation component for AI streaming responses. Handles cursor, timing, and can be paused/resumed.

Preview

Props

PropTypeDefaultDescription
contentstringFull text to stream character by character.
speednumber30Delay in ms between characters.
showCursorbooleantrueShow blinking cursor at the end.
cursorCharstring"|"Character used for cursor.
onComplete() => voidCallback when streaming finishes.
autoStartbooleantrueStart immediately on mount.
wordPausenumber0Extra pause in ms between words.
streamingbooleantruePause/resume control.
onCharacter(index: number) => voidFires after each character rendered.

Performance

StreamingText uses a single state index and timeouts to avoid unnecessary re-renders.