Dynamic Route

This page demonstrates a dynamic route in Next.js, where the URL itself determines which content is displayed. Any segment placed in the URL (such as /docs/intro or /docs/getting-started) is captured by the [slug] folder and passed into the page as a parameter. Dynamic routing is ideal for documentation pages, blog posts, user profiles, product pages, or any content that depends on a variable path.

Expected Behaviour

When you navigate to a URL like /docs/anything, the value after /docs/ becomes the slug parameter. This page simply displays the slug so you can see how the routing system works. In a real application, the slug would be used to load the correct content from a database, CMS, or filesystem.

How This Page Works

  • The folder name [slug] tells Next.js to treat it as a dynamic route.
  • Any value in that part of the URL is captured as params.slug.
  • The page receives params automatically from Next.js.
  • The slug is displayed directly on the page for demonstration.

You opened: intro