loading.tsx
A special file whose component Next.js shows instantly while a route segment's page is loading, by wrapping the page in Suspense.
In more detail
It is sent immediately on first load and on navigation, and navigation stays interruptible while it shows. Because it covers the whole page, add your own Suspense boundaries when parts of the page load at different speeds.
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.
- streaming SSR — Server-side rendering that sends the HTML shell immediately and streams the rest of the page as each piece of data becomes ready.
Taught in
- Server Components: Async Execution & Constraints — Next.js 15 & Modern App Router Architecture
- Parallel & Intercepting Routes: Modals & Split Views — Next.js 15 & Modern App Router Architecture
- Streaming SSR: Progressive HTML & Chunked Transfers — 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