Routing: Linking and Navigating | Next.js
This page will go through how to use each of these options, and dive deeper into how navigation works. is a built-in component that extends the HTML tag to provide prefetching and client-side navigation between routes. It is the primary and recommended way to navigate between routes in Next.js. You can use it by importing it from next/link, and passing a href prop to the component: There are other optional props you can pass to . See the API reference for more. When linking to dynamic segments, you can use template literals and interpolation to generate a list of links. For example, to generate a list of blog posts: You can use usePathname() to determine if a link is active. For example, to add a class to the active link, you can check if the current pathname matches the href of the link: The default behavior of the Next.js App Router is to scroll to the top of a new route or to maintain the scroll position for backwards and forwards navigation. If you'd like to scrol
This page is also available as Markdown at /docs/app/getting-started/linking-and-navigating.md . For an index of Next.js documentation , see /docs/llms.txt . Copy page Linking and Navigating Last updated June 23, 2026 In Next.js, routes are rendered on the server by default. This often means the client has to wait for a server response before a new route can be shown. Next.js comes with built-in prefetching , streaming , and client-side transitions ensuring navigation stays fast and responsive. This guide explains how navigation works in Next.js and how you can optimize it for dynamic routes a
Explore this link on the map →related reading
- App Router: Navigating Between Pages | Next.jsnextjs.org
- Getting Started: Layouts and Pages | Next.jsnextjs.org
- File-system conventions: loading.js | Next.jsnextjs.org
- Building a single-page application with Next.js and React Routercolinhacks.com
- Cursor Docs — Agent, Rules, MCP, Skills & CLIdocs.cursor.com
- App Router: Streaming | Next.jsnextjs.org
- Getting Started: Caching | 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
- GitHub - emanuelefavero/next-js: A Next.js cheat sheet repository · GitHubgithub.com
- One Year with Next.js App Router — Why We're Moving Onpaperclover.net