Streaming Response

A stable response surface with completion actions, rendered content, and an expandable source summary.

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.

status?
"complete" | "error" | "streaming"
streaming
copyText?
string

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

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

Overrides the built-in clipboard action.

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

Optional sources shown as a compact footer disclosure after streaming.

[]
sourcesOpen?
boolean
defaultSourcesOpen?
boolean
false
onSourcesOpenChange?
((open: boolean) => void)
sourceIdPrefix?
string
feedback?
StreamingResponseFeedback
defaultFeedback?
StreamingResponseFeedback
null
onFeedbackChange?
((feedback: StreamingResponseFeedback) => void)
announce?
boolean

Set false when a surrounding conversation log announces streamed text.

true
showActions?
boolean

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

true
className?
string
contentClassName?
string
actionsClassName?
string

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.

Updated