loading.tsx file convention creates instant loading states that appear immediately during navigation.loading.tsx at any route level for granular control over which segments show loading UI.1export default function Loading() {2return (3<div className="animate-pulse">4{/* Skeleton matches final content shape */}5// !mark6<div className="h-8 w-48 rounded bg-gray-200" />7<div className="mt-4 space-y-3">8<div className="h-4 rounded bg-gray-200" />9<div className="h-4 w-5/6 rounded bg-gray-200" />10</div>11</div>12);13}
An artificial delay is added to make the loading state visible.
Loading UI provides instant feedback while server content streams in.
| Topic | Guidance |
|---|---|
| Instant feedback | URL updates before content loads |
| Prefetching | Loading states can be prefetched |
| Interruptible | Navigation can be cancelled mid-load |
| Granular control | Different loading UI per route segment |








