File conventions

Pages Router index and dynamic file mapping

An index file maps to its containing URL directory; square-bracket names map dynamic path segments. These conventions belong to Pages Router and differ from App Router page files. Validate dynamic data before selecting a resource. Example context: isolated Next.js 16.x candidate; snippet is partial unless it defines a complete convention file. Lifecycle: documented. Expected behavior / verification: The route matches /catalog/moss and /catalog/fern; it does not by itself prove either item exists. Test direct requests and collisions. Source: https://nextjs.org/docs/pages/building-your-application/routing/pages-and-layouts Exact installed signature, typecheck and framework execution not run.

Formal Syntax & Structure

nextjs syntaxnextjs
pages/index.tsx; pages/catalog/[slug].tsx

Working Example

Example Snippetnextjs
// pages/catalog/[slug].tsxexport default function Book(){return <h1>Catalog item</h1>}
Next.js Reference