Course contentsShow
← React
Lesson 1373 of 2,39634. Suspense FundamentalsFree lesson

Common Fallback Patterns: Spinners and Skeletons

Fallbacks typically render loading spinners for full-screen loads or skeleton UI matching content shape.

Common Fallback Patterns: Spinners and Skeletons

What you'll learn: The two most popular ways to design Suspense fallback UI—full-screen spinners for major loads and skeleton screens that match your content's shape.

The Two Dominant Patterns

When a Suspense boundary suspends, you need to decide what the fallback should look like. Two patterns have emerged as industry standards:

Spinners work best for full-page or major section loads. When the entire route or a large feature is loading, a centered spinner communicates "the whole thing is coming" clearly. Think of it like waiting for a door to open—you just see a "loading" indicator until everything is ready.

Skeleton UI works best when replacing specific content areas. Instead of a generic spinner, you render gray placeholder boxes that match the shape of the content that will appear—a rectangle for an image, lines for text paragraphs, circles for avatars. This is like seeing the outline of a building before it's painted—users understand what kind of content is loading and where it will appear.

Why Shape Matters

Skeletons reduce perceived loading time because they set spatial expectations. Users see "ah, there will be a profile photo here, a title there" rather than staring at a blank spinner wondering what's coming. The layout doesn't shift dramatically when content arrives.

Spinners are simpler but less informative. Use them when the content structure itself is unknown or when the loading time is expected to be very short.

Matching Context to Pattern

Small component suspensions → skeleton matching that component's layout
Full route changes → centered spinner
List items → repeated skeleton "cards"
Hero sections → large skeleton blocks

Key Takeaway: Use spinners for full-screen loads and skeleton UI that mirrors content shape for partial, in-place loading—both give users visual feedback while Suspense waits for data or code.