not-found.tsx

A special file that renders a custom "not found" screen when a route does not exist or notFound() is called.

In more detail

The nearest not-found.tsx above the call is used, so sections can have their own messages. It can be a Server Component, and Next.js sends a 404 status, or a noindex tag when streaming has already started.

Related terms

Taught in

References