Site Themes275 Documents

New Tab Link

In sites and themes, including site core, runnable sites, theme repositories, and individual themes, use the shared NewTabLink component imported from newTabLink for links that open a new tab. Do not declare target="_blank" or a dynamic target in other JSX. NewTabLink owns target="_blank" and always includes noopener, preserving additional rel tokens. Add noreferrer only when hiding referral information is intended. Ordinary same-tab links may use semantic anchors.

Philosophy

Shared infrastructure owns new-tab behavior so sites and themes declare their intent once.

Correct

import NewTabLink from 'newTabLink'

<NewTabLink href={href}>Open page</NewTabLink>

Incorrect

<a href={href} target='_blank'>Open page</a>

Fix

Import NewTabLink from newTabLink and replace the new-tab link with it. Remove the target prop; forward the link attributes and children. Separate dynamic same-tab and new-tab rendering into the appropriate link components.