Streaming Response

Preview

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/streaming-response

API Reference

children
ReactNode

Rendered response content. Pass plain text or the output of a Markdown renderer.

Default—
status?
"complete" | "streaming" | "error"
Defaultstreaming
copyText?
string

Plain-text value copied by the built-in copy action.

Default—
onCopy?
(() => void | Promise<void>)

Overrides the built-in clipboard action.

Default—
onRetry?
(() => void)
Default—
sources?
CitationItem[]

Optional sources shown as a compact footer disclosure after streaming.

Default[]
sourcesOpen?
boolean
Default—
defaultSourcesOpen?
boolean
Defaultfalse
onSourcesOpenChange?
((open: boolean) => void)
Default—
sourceIdPrefix?
string
Default—
feedback?
StreamingResponseFeedback
Default—
defaultFeedback?
StreamingResponseFeedback
Defaultnull
onFeedbackChange?
((feedback: StreamingResponseFeedback) => void)
Default—
announce?
boolean

Set false when a surrounding conversation log announces streamed text.

Defaulttrue
showActions?
boolean

Hides the built-in completion actions without changing response status.

Defaulttrue
className?
string
Default—
contentClassName?
string
Default—
actionsClassName?
string
Default—

Composition

Keep response state inside the message surface while the outer row remains stable.

Message
└── MessageContent
    └── MessageBubble
        └── StreamingResponse

Note: Message places the response in a stable assistant row. Citations connects completed claims to supporting sources. Code Block renders structured source inside a rich response.

How it works

A response has two distinct phases: content is still arriving, then the answer becomes available for action. The layout should remain stable across that boundary while rich content continues to render normally.

Also on React Native. A reply that streams in, then settles with actions.

Updated