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

> Learn how to open a link in a new window in Next.js by adding a target attribute set to _blank on the inner a tag while href stays on the Link component.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2021-06-24 | Topics: [Next.js](https://flaviocopes.com/tags/next/) | Canonical: https://flaviocopes.com/nextjs-open-link-new-window/

Here's how you can open a link in a new window in [Next.js](https://flaviocopes.com/nextjs/):

```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.
