Nextjs Fundamentals · Navigation

Navigating with Link

`<Link>` and client transitions

Navigating with Link

In the App Router, navigate between routes with the <Link> component from next/link. It renders an <a> element but upgrades the click into a client-side transition — no full page reload:

import Link from 'next/link';

export function Nav() {
  return (
    <nav>
      <Link href="/blog">Blog</Link>
      <Link href="/about">About</Link>
    </nav>
  );
}

A client-side transition is the key idea. A plain <a> asks the browser to request a new HTML document, which clears state, resets scroll, and blocks interactivity. <Link> instead asks Next.js to update the route on the client: it keeps any shared layouts mounted, swaps in the new page, and updates the URL. Server-rendered pages end up feeling like a single-page app.

<Link> also prefetches a route when the link enters the viewport, so the next page's data is often already there by the time you click. That is what makes navigation feel instant.

Use <Link> for navigation inside your app. For an external site, a plain <a href="https://…"> is correct — the client-side router has nothing to render for it.

You can disable prefetching per link with prefetch={false}, and by default a transition scrolls to the top of the page.

You are about to answer a short quiz on <Link> and client transitions.

  1. `<Link>` from `next/link` upgrades a click into a client-side transition without a full page reload.
  2. You should use `<Link>` for links to external websites.
  3. Next.js automatically ___ a route linked with `<Link>` when the link enters the viewport.
  4. A client-side transition keeps shared layouts mounted instead of reloading the whole document.
  5. By default, a client-side transition scrolls to the ___ of the page.
  6. Setting `prefetch={false}` on a `<Link>` opts that link out of prefetching.