YuhuanStudioYunUIDocs
Chat

StreamingText

Provide exact text tokens, stable source IDs and stream state from the host. One public component renders citations, source disclosure, message actions and follow-ups; it never calls a model or simulates streaming.

Provide exact text tokens, stable source IDs and stream state from the host. One public component renders citations, source disclosure, message actions and follow-ups; it never calls a model or simulates streaming.

Import

tsx1 line
import { StreamingText } from "@yuhuanowo/yunui/chat";

Interactive example

The controls below explicitly simulate host responses; no request is sent. All labels and accessibility copy can be overridden. Missing callbacks disable the corresponding request controls.

StreamingText

The conversation components now use the public YunUI API. YunUI docs Review the proposed changes before applying them.

Follow-ups

No request sent.

Composition

tsx3 linesScroll horizontally
import { StreamingText } from "@yuhuanowo/yunui/chat";

<StreamingText content={[{ text: "Read the guide. " }, { text: "", sourceId: "guide" }]} sources={[{ id: "guide", name: "Guide", href: "/guide" }]} state="complete" />

Props

PropTypeDefaultDescription
classNamestring—
content*readonly StreamingToken[]—Exact host-provided token sequence. YunUI does not insert or normalize whitespace.
defaultSourcesOpenbooleanfalse
followUpsreadonly string[][]
labelsStreamingTextLabels—
onAction((action: StreamingAction) => void)—
onFollowUp((text: string, index: number) => void)—
onSourcesOpenChange((open: boolean) => void)—
sourcesreadonly StreamingSource[][]
sourcesOpenboolean—Controlled source disclosure. Without `onSourcesOpenChange`, it is read-only.
state"streaming" | "complete" | "error" | "cancelled" | "empty"complete
visibleCountnumber—Optional host-controlled prefix length while streaming.

On this page