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

Taught in

References