📄 ai-sdk/docs/advanced/multiple-streamables

File: multiple-streamables.md | Updated: 11/15/2025

Source: https://ai-sdk.dev/docs/advanced/multiple-streamables

AI SDK

Menu

v5 (Latest)

AI SDK 5.x

AI SDK by Vercel

AI SDK 6 Beta

Foundations

Overview

Providers and Models

Prompts

Tools

Streaming

Getting Started

Navigating the Library

Next.js App Router

Next.js Pages Router

Svelte

Vue.js (Nuxt)

Node.js

Expo

Agents

Agents

Building Agents

Workflow Patterns

Loop Control

AI SDK Core

Overview

Generating Text

Generating Structured Data

Tool Calling

Model Context Protocol (MCP) Tools

Prompt Engineering

Settings

Embeddings

Image Generation

Transcription

Speech

Language Model Middleware

Provider & Model Management

Error Handling

Testing

Telemetry

AI SDK UI

Overview

Chatbot

Chatbot Message Persistence

Chatbot Resume Streams

Chatbot Tool Usage

Generative User Interfaces

Completion

Object Generation

Streaming Custom Data

Error Handling

Transport

Reading UIMessage Streams

Message Metadata

Stream Protocols

AI SDK RSC

Advanced

Prompt Engineering

Stopping Streams

Backpressure

Caching

Multiple Streamables

Rate Limiting

Rendering UI with Language Models

Language Models as Routers

Multistep Interfaces

Sequential Generations

Vercel Deployment Guide

Reference

AI SDK Core

AI SDK UI

AI SDK RSC

Stream Helpers

AI SDK Errors

Migration Guides

Troubleshooting

Copy markdown

Multiple Streams

===========================================================================================

Multiple Streamable UIs


The AI SDK RSC APIs allow you to compose and return any number of streamable UIs, along with other data, in a single request. This can be useful when you want to decouple the UI into smaller components and stream them separately.

'use server';
import { createStreamableUI } from '@ai-sdk/rsc';
export async function getWeather() {  const weatherUI = createStreamableUI();  const forecastUI = createStreamableUI();
  weatherUI.update(<div>Loading weather...</div>);  forecastUI.update(<div>Loading forecast...</div>);
  getWeatherData().then(weatherData => {    weatherUI.done(<div>{weatherData}</div>);  });
  getForecastData().then(forecastData => {    forecastUI.done(<div>{forecastData}</div>);  });
  // Return both streamable UIs and other data fields.  return {    requestedAt: Date.now(),    weather: weatherUI.value,    forecast: forecastUI.value,  };}

The client side code is similar to the previous example, but the tool call will return the new data structure with the weather and forecast UIs. Depending on the speed of getting weather and forecast data, these two components might be updated independently.

Nested Streamable UIs


You can stream UI components within other UI components. This allows you to create complex UIs that are built up from smaller, reusable components. In the example below, we pass a historyChart streamable as a prop to a StockCard component. The StockCard can render the historyChart streamable, and it will automatically update as the server responds with new data.

async function getStockHistoryChart({ symbol: string }) {  'use server';
  const ui = createStreamableUI(<Spinner />);
  // We need to wrap this in an async IIFE to avoid blocking.  (async () => {    const price = await getStockPrice({ symbol });
    // Show a spinner as the history chart for now.    const historyChart = createStreamableUI(<Spinner />);    ui.done(<StockCard historyChart={historyChart.value} price={price} />);
    // Getting the history data and then update that part of the UI.    const historyData = await fetch('https://my-stock-data-api.com');    historyChart.done(<HistoryChart data={historyData} />);  })();
  return ui;}

On this page

Multiple Streams

Multiple Streamable UIs

Nested Streamable UIs

Deploy and Scale AI Apps with Vercel.

Vercel delivers the infrastructure and developer experience you need to ship reliable AI-powered applications at scale.

Trusted by industry leaders:

  • OpenAI
  • Photoroom
  • leonardo-ai Logoleonardo-ai Logo
  • zapier Logozapier Logo

Talk to an expert