Jan 22, 2024
After the NextJS 13 Update you can use target props with NextJS Link.
<Link
href="/open-in-new-tab"
target="_blank" <------ add this in your link tag
>
Open In New Tab
</Link>
Before NextJS 13 we used <a> tag inside <Link> tag in NextJS like this.
<Link href="./page-here">
<a target="_blank">
New tab
</a>
</Link>
Suppose you have a hello-world.pdf file in public folder. You want to create a download button.
<Link href="./hello-world.pdf" target="_blank download>
Open Pdf
</Link>
You just need to add target="_blank" in your <Link> tag