StreamingText

Text that arrives rather than appears — the assistant writing, with a warm tail and a blurred leading edge.

Install it:

npx shadcn add @ambientui/streaming-text

Live

Behavior

  • ·Three zones travel with the write head: settled text in the foreground, a warm tail in the ambient accent, and a blurred edge behind a fading mask.
  • ·The reveal runs on the FRAME CLOCK and derives the write head from ELAPSED TIME rather than by counting ticks. A hidden tab pauses the frame loop either way; what this buys is the recovery — coming back, the head is where the clock says it should be, not wherever a throttled timer had counted to.
  • ·charsPerSecond sets the pace; the default reads as deliberate writing rather than a printer.
  • ·live={false} renders the whole string settled, so a re-rendered older message never re-types itself — history is written, not replayed.
  • ·A finished message RECORDS that it finished, so live={false} survives the surface changing. Dragging panel → dock remounts the transcript; without the record, position alone would say "newest message" and the answer would perform itself again.
  • ·onSettled fires shortly after the last character, which is what returns the ambient layer to rest.
  • ·Purely presentational: the characters are already in the DOM, so selection and copy give the full text at any point.

When to use

  • ·Any assistant text that is genuinely being produced as you watch.
  • ·When the pace of arrival is information — a slow answer should look slow.

When not to

  • ·Text that is already known — faking a stream is a lie about latency.
  • ·Long documents or code; use a settled block and show progress elsewhere.
  • ·Product copy of any kind: this treatment says an assistant is writing.