Nested Fallbacks for Granular Loading
What You'll Learn: How to use multiple Suspense boundaries at different depths to show loading states for specific parts of your UI instead of blocking the entire page.
The Core Idea
Instead of wrapping your entire app in a single Suspense boundary that shows one giant spinner, you can nest Suspense components throughout your component tree. Each boundary controls its own "loading zone" — when something suspends inside that boundary, only that section shows a fallback while the rest of your UI remains visible and interactive.
Think of it like a restaurant kitchen: Instead of closing the entire restaurant when one dish takes longer to prepare, you keep serving the appetizers and drinks while the main course cooks. Each part of the meal has its own timeline.
How It Works
<Suspense fallback={<PageSpinner />}>
<Header />
<Suspense fallback={<SidebarSkeleton />}>
<Sidebar />
</Suspense>
<main>
<Suspense fallback={<ArticleLoader />}>
<Article />
</Suspense>
<Suspense fallback={<CommentsSkeleton />}>
<Comments />
</Suspense>
</main>
</Suspense>
Here, Header loads immediately. If Sidebar suspends, only the sidebar area shows its skeleton — the article can still load. If Comments suspend, the article stays visible while comments load separately. Each boundary "catches" suspensions from its children only.
Progressive Disclosure
The outer boundary acts as a safety net: if everything suspends simultaneously, you get the page-level spinner. But as data arrives piece-by-piece, users see a progressively populated page rather than a blank screen followed by everything appearing at once.
Key Takeaway: Nesting Suspense boundaries lets you control loading granularity — show spinners only where data is missing, keeping the rest of your UI interactive and visible.