fallback UI
The placeholder content React shows instead of part of the tree, either while it loads (Suspense) or after it crashes (error boundary).
In more detail
Good fallbacks keep the page layout stable and tell the user what is happening, such as a skeleton for loading or a message with a retry button for errors. The fallback replaces only the part of the tree inside the nearest boundary, so the rest of the page stays usable.
Related terms
- Suspense — A React component that shows a fallback, such as a spinner or skeleton, while components inside it are waiting for something to load.
- skeleton screen — A grey outline of the content that is about to load, shaped like the real layout, shown instead of a spinner.
- error boundary — A class component that catches errors thrown while rendering its children and shows a fallback UI instead of crashing the whole app.
Taught in
- Dynamic Routes: Slugs & generateStaticParams — Next.js 15 & Modern App Router Architecture
- Parallel & Intercepting Routes: Modals & Split Views — Next.js 15 & Modern App Router Architecture
- Loading UI: Instant Loading States with loading.tsx — Next.js 15 & Modern App Router Architecture
- Granular Suspense: Resolving Waterfall Bottlenecks — Next.js 15 & Modern App Router Architecture
- Not Found Handling: not-found.tsx & Programmatic Exits — Next.js 15 & Modern App Router Architecture
- Image & Font Optimization: Zero Layout Shift Assets — Next.js 15 & Modern App Router Architecture
- useContext in Depth: Scoping, Consumer Subscription Costs — React 19 & Modern Component Architecture
- useSyncExternalStore: Tearing-Free Store Subscriptions — React 19 & Modern Component Architecture
- The use() Hook: Reading Promises And Context Directly — React 19 & Modern Component Architecture
- Suspense Architecture: Promises, Fallbacks, And Co-ordination — React 19 & Modern Component Architecture
- Code-Splitting with React.lazy: Dynamic Imports And Chunks — React 19 & Modern Component Architecture
- Error Boundaries: componentDidCatch And Fallback UI Trees — React 19 & Modern Component Architecture
- Client-Side Data Fetching Architectures with Suspense — React 19 & Modern Component Architecture