Recipes: Next.js, how to open a link in a new window

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


Here’s how you can open a link in a new window in Next.js:

<Link href={url}>
  <a target="_blank">Click this link</a>
</Link>

You first wrap the a tag in a Link component (the Link component provided by Next.js, and inside the a tag you add a target="_blank" attribute, just like you’d do in plain HTML.

The href attribute stays on the Link component, to play well with client-side routing.

Lessons in this unit:

0: Introduction
1: Using the router to detect the active link in Next.js
2: Next.js Email Authentication using NextAuth
3: Next.js embed youtube video - next
4: How to force a page refresh in Next.js
5: How to add Google Analytics 4 to Next.js
6: ▶︎ Next.js, how to open a link in a new window
7: How to parse Markdown in Next.js
8: How to add ReCaptcha to a Next.js form
9: How to upload files in a Next.js form