Skip to content

Streaming Text

Tegaki can animate text as it arrives from a streaming API, making it perfect for AI chat interfaces.

Use uncontrolled mode — it automatically tracks the growing text and animates new characters as they arrive. The catchUp option gently speeds up playback when there’s buffered text, so the animation stays close to the stream without jumping.

import { TegakiRenderer } from 'tegaki';

function StreamingMessage({ text, font }) {
  return (
    <TegakiRenderer
      font={font}
      time={{ mode: 'uncontrolled', speed: 4, catchUp: 0.5 }}
    >
      {text}
    </TegakiRenderer>
  );
}

Update text as chunks arrive from your API — Tegaki handles the rest.

  • speed — base playback speed multiplier (default 1). Higher values write faster.
  • catchUp — how aggressively the animation speeds up to close the gap when text arrives faster than it can be drawn. 0 disables catch-up (default). Typical range: 0.22.

See the chat demo on the homepage for an example of streaming handwriting animation.