Skip to Content
zjkm-ui
Components

Streaming Text

Streaming LLM text.

ProPro, coming soon.
Props
<StreamingText text={text} streaming={isStreaming} />

Get notified

Streaming Text is a Pro effect. Join the waitlist and we'll email you when it's available.

Usage

Pass everything streamed so far on each update. Each new piece fades in where it lands, and a caret blinks at the end while streaming is on. If the new text doesn't continue the old one, for a new answer, it starts over.

import { StreamingText } from "@zjkm/pro/streaming-text";

export function Answer({ text, done }: { text: string; done: boolean }) {
  return <StreamingText text={text} streaming={!done} />;
}

It renders plain text with line breaks kept. For Markdown, render the finished answer with your Markdown renderer once streaming ends.

Props

PropTypeDefaultDescription
textstringEverything streamed so far.
streamingbooleanfalseShows the caret and sets aria-busy.
classNamestringClasses for the wrapper.

With reduced motion, text appears without fading and the caret doesn't blink.

On this page