# Stream Status Provider URL: /concepts/streaming/tambo-prop-stream-provider The `TamboPropStreamProvider` uses a **compound component pattern** to manage streaming state. You wrap your content with the main provider and use its sub-components to define what renders at each streaming stage. ```tsx title="basic-usage.tsx" import { TamboPropStreamProvider } from "@tambo-ai/react"; function WeatherCard({ location, temperature, condition }) { return (
Loading weather...

{location}

{temperature}°C, {condition}

); } ``` ## Why Use the Stream Status Provider? * **Declarative rendering** - Use compound components to define what shows in each state * **Per-prop tracking** - Handle individual prop streaming (e.g., show title while body loads) * **Enhanced UX** - Add highlighting, animations, or transitions during streaming This guide builds on **[Streaming](/concepts/streaming)** and **[Component Streaming Status](/concepts/streaming/component-streaming-status)**. We recommend reading those first. ## API Reference ### Compound Components **``** - Renders when the stream is pending (no data yet) **``** - Renders when the stream is actively streaming data **``** - Renders when data is successfully received and complete ### useTamboStream Hook Access the stream context within the provider: ```tsx const { data, streamStatus, getStatusForKey } = useTamboStream(); ``` The **[useTamboStream](/concepts/streaming/use-tambo-stream)** hook provides access to the stream context within the provider. ## Usage Examples ### Per-Prop Streaming Track individual properties using the `streamKey` prop to show content progressively: ```tsx title="per-property-streaming.tsx" function ArticleCard({ title, summary }) { return (
Loading title...

{title}

Loading summary...

{summary}

); } ``` ### Error Handling and All States Handle all possible streaming states including errors and empty states: ```tsx title="complete-error-handling.tsx" function RobustComponent({ data }) { const { streamStatus } = useTamboStreamStatus(); return (
AI is generating content...
No content generated yet
{data.content}
{streamStatus.isError && (
Error: {streamStatus.streamError?.message}
)}
); } ``` ### Real-Time Streaming with Fallbacks Show streaming values immediately as they arrive with controlled fallbacks: ```tsx title="real-time-streaming.tsx" function StreamingTextGenerator({ content, title, metadata }) { return (

{title || "Generating title..."}

{title}

{content || "AI is writing..."}

{content}

Generated: {metadata.timestamp} Words: {metadata.wordCount}
); } ``` ### Custom Animations Add visual feedback during streaming: ```tsx title="custom-animations.tsx"
Loading title...

{title}

```