createStreamableUI

AI SDK RSC is currently experimental. We recommend using AI SDK UI for production. For guidance on migrating from RSC to UI, see our migration guide.

Create a stream that sends UI from the server to the client. On the client side, it can be rendered as a normal React node.

Import

import { createStreamableUI } from "@ai-sdk/rsc"

API Signature

Parameters

initialValue?:

ReactNode

Returns

value:

ReactNode

Methods

update:

(ReactNode) => void

append:

(ReactNode) => void

done:

(ReactNode | null) => void

error:

(Error) => void

Examples

Render a React component during a tool call