Routing: Loading UI and Streaming | Next.js
Built on top of Suspense, Loading UI allows you to create a fallback for specific route segments, and automatically stream content as it becomes ready.
This page is also available as Markdown at /docs/app/api-reference/file-conventions/loading.md . For an index of Next.js documentation , see /docs/llms.txt . Copy page loading.js Last updated March 13, 2026 The special file loading.js helps you create meaningful Loading UI with React Suspense . With this convention, you can show an instant loading state from the server while the content of a route segment streams in. The new content is automatically swapped in once complete. app/feed/loading.tsx TypeScript JavaScript TypeScript export default function Loading () { // Or a custom loading skelet
saved by
related reading
- Getting Started: Error Handling | Next.jsnextjs.org
- Getting Started: Layouts and Pages | Next.jsnextjs.org
- Getting Started: Fetching Data | Next.jsnextjs.org
- Getting Started: Fetching Data | Next.jsnextjs.org
- Getting Started: Caching | Next.jsnextjs.org
- App Router: Streaming | Next.jsnextjs.org
- API Reference: Edge Runtime | Next.jsnextjs.org
- Getting Started: Linking and Navigating | Next.jsnextjs.org
- RSC From Scratch. Part 1: Server Components · reactwg server-components · Discussion #5github.com
- Making Sense of React Server Components • Josh W. Comeaujoshwcomeau.com
- Getting Started: Fetching Data | Next.jsnextjs.org
- Cursor Docs — Agent, Rules, MCP, Skills & CLIdocs.cursor.com