Components
Streaming Text
Streaming LLM text.
ProPro, coming soon.
<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
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | Everything streamed so far. | |
streaming | boolean | false | Shows the caret and sets aria-busy. |
className | string | Classes for the wrapper. |
With reduced motion, text appears without fading and the caret doesn't blink.