# Component Streaming Status URL: /concepts/streaming/component-streaming-status The `useTamboStreamStatus` hook lets you track both overall and per-prop streaming status, so you can show loading or completed states for each prop as they arrive. ## How Does It Work? Without per-prop tracking, you're forced to show nothing until all props are ready (poor UX) or show everything with default values (potentially confusing). This hook gives you granular control over what renders when. ```tsx title="basic-usage.tsx" import { useTamboStreamStatus } from "@tambo-ai/react"; function Note({ title, content, createdAt }) { const { streamStatus, propStatus } = useTamboStreamStatus(); // Wait for everything to complete if (!streamStatus.isSuccess) return ; return (

{title}

{content}

{propStatus["createdAt"]?.isSuccess &&

{createdAt}

}
); } ``` This guide builds on **[Streaming](/concepts/streaming)** and **[Response Component Streaming](/concepts/streaming/response-component-streaming)**. We recommend reading those first. ## Status Types ### Global Stream Status (`streamStatus`) Tracks the overall state of the entire component: | Field | Type | Description | | -------------- | --------- | -------------------------------------------------------- | | `isPending` | `boolean` | No tokens received yet, show initial loading state | | `isStreaming` | `boolean` | Active data transmission (generation OR props streaming) | | `isSuccess` | `boolean` | All props completed successfully | | `isError` | `boolean` | Any fatal error occurred in generation or props | | `streamError?` | `Error` | First error encountered during streaming | ### Per-Prop Status (`propStatus`) Tracks individual prop streaming states: | Field | Type | Description | | ------------- | --------- | ------------------------------------------------- | | `isPending` | `boolean` | No tokens received for this specific prop yet | | `isStreaming` | `boolean` | Partial content received, prop is still updating | | `isSuccess` | `boolean` | Prop finished streaming successfully | | `error?` | `Error` | Error that occurred during streaming of this prop | ## Usage Patterns ### Wait for Everything to Complete ```tsx title="wait-for-all.tsx" function ArticleCard({ title, content, author }) { const { streamStatus } = useTamboStreamStatus(); if (streamStatus.isPending) return
; if (streamStatus.isError) return
Error: {streamStatus.streamError?.message}
; if (!streamStatus.isSuccess) return ; return (

{title}

{content}

By {author}
); } ``` ### Progressive Rendering Show each prop as it becomes available: ```tsx title="progressive-rendering.tsx" function DashboardWidget({ title, data, config }) { const { propStatus } = useTamboStreamStatus(); return (
{propStatus["title"]?.isPending &&
} {propStatus["title"]?.isSuccess &&

{title}

} {propStatus["data"]?.isStreaming && } {propStatus["data"]?.isSuccess && } {propStatus["config"]?.isSuccess && }
); } ``` ### Advanced Patterns Handle errors and group related props: ```tsx title="advanced-patterns.tsx" function BlogPost({ title, author, content, tags }: BlogPostProps) { const { propStatus } = useTamboStreamStatus(); return (
{/* Group header content */} {propStatus["title"]?.isSuccess && propStatus["author"]?.isSuccess && (

{title}

By {author}
)}
{content}
{/* Handle errors gracefully */} {propStatus["tags"]?.error &&

Failed to load tags

} {propStatus["tags"]?.isSuccess && (
{tags.map((tag) => ( {tag} ))}
)}
); } ``` ## When to Use Component Streaming Status **✅ Use When** * Different props have different loading times * You want progressive rendering * You need fine-grained error handling * You have complex UI that depends on multiple props **❌ Don't Use When** * You only have simple text content * You're doing SSR/SSG (client-side only) ## Integration with Other Tambo Features ### With Stream Status Provider ```tsx title="with-provider.tsx" import { TamboPropStreamProvider, useTamboStreamStatus } from "@tambo-ai/react"; function EnhancedComponent({ title, content, metadata }) { const { streamStatus } = useTamboStreamStatus(); return (

{title}

{content}
); } ``` The **[Stream Status Provider](/concepts/streaming/tambo-prop-stream-provider)** provides declarative streaming state management with built-in loading and complete states for individual props. ### With Streaming Props Hook ```tsx title="with-streaming-props.tsx" import { useTamboStreamingProps, useTamboStreamStatus } from "@tambo-ai/react"; function StatefulComponent({ streamedTitle, streamedContent }) { const { propStatus } = useTamboStreamStatus(); const [state, setState] = useState({ title: "", content: "" }); useTamboStreamingProps(state, setState, { title: streamedTitle, content: streamedContent, }); return (

{state.title}

{propStatus["content"]?.isSuccess &&

{state.content}

}
); } ``` The **[Streaming Props into State](/concepts/streaming/streaming-props)** feature allows you to automatically update component state as props stream in, providing seamless integration with React state management.