Course contentsShow
← React
Lesson 1666 of 2,39640. Server-Side RenderingFree lesson

The Shell-First, Then Content Pattern

Learn the pattern where the page shell renders immediately while slower content streams in later within Suspense boundaries.

The Shell-First, Then Content Pattern

What you'll learn: How to render your page structure immediately while slower data loads inside Suspense boundaries.


When you combine streaming SSR with Suspense boundaries, you unlock a powerful UX pattern: send the shell of your page (layout, navigation, skeleton UI) instantly, then stream in the content as data becomes ready.

The Core Idea

Think of a restaurant that seats you immediately and brings water and bread (the shell) while the kitchen prepares your entrée (the content). You're engaged and comfortable, not standing outside waiting for everything to be ready at once.

In React streaming SSR, the "shell" is everything that doesn't require slow data fetching:

  • Navigation bars
  • Page headers
  • Footer
  • Skeleton loaders or placeholders

The "content" lives inside <Suspense> boundaries—components that fetch data from databases, APIs, or perform heavy computations.

How It Works

When a request arrives, React immediately renders and streams the shell (the parts outside Suspense). The browser receives this HTML in milliseconds and can paint the page structure. Meanwhile, components inside Suspense boundaries are still fetching data on the server. As each finishes, React streams that HTML chunk and the browser seamlessly inserts it.

The user sees something instantly—not a blank screen—which dramatically improves perceived performance. Time to First Byte (TTFB) and First Contentful Paint (FCP) improve because you're not blocking the entire render on the slowest query.

Key Takeaway: The shell-first pattern means structuring your app so fast, non-blocking UI renders and streams immediately, while slower data-dependent content streams later within Suspense boundaries, creating a progressive loading experience.