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

Finding the Right Granularity

Strategies for placing boundaries around meaningful UI sections that should load together.

Finding the Right Granularity

What you'll learn: How to strategically place Suspense boundaries around UI sections that logically load together, balancing user experience with development complexity.

You've seen the extremes: boundaries that are too coarse (one giant spinner for the entire app) and too fine (individual spinners for every tiny component). The sweet spot lies in identifying meaningful UI units that should load as a cohesive group.

Think in User-Perceived Sections

The right granularity follows how users mentally chunk your interface. Consider an e-commerce product page:

  • Product details section (image, title, price) — loads together
  • Reviews section — separate boundary, can load independently
  • Related products carousel — another independent section

Each of these represents a conceptual unit from the user's perspective. They don't need to all load simultaneously, but within each section, the parts feel connected.

Practical Guidelines

Wrap boundaries around:

  • Complete features (a dashboard widget, a comment thread)
  • Navigation-level chunks (different routes)
  • Content that shares the same data dependency
  • UI sections visually separated by layout (cards, panels, tabs)

Avoid wrapping:

  • Individual text fields or buttons
  • Fragments of a single visual component
  • Elements that create jarring layout shifts when they appear separately

The Layout Shift Test

If staggered loading causes confusing jumps or makes the page feel broken, those elements probably belong in the same boundary. Conversely, if two sections can load independently without visual disruption, separate boundaries improve perceived performance.

Key Takeaway: Place Suspense boundaries around UI sections that users perceive as single units — features, cards, or route-level chunks — not around individual tiny components or the entire application.