Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

Link

The link component makes text interactive, allowing users to navigate to other pages or perform specific actions. Use link for navigation, external references, or triggering actions while maintaining standard link semantics and accessibility.

Support
Targets (25)

Configure the following properties on the Link component.

Anchor to accessibilityLabel
accessibilityLabel
string

A label used for buyers using assistive technologies. When set, any children supplied to this component will not be announced to screen reader users.

Anchor to activateAction
activateAction
'auto' | 'copy'
Default: 'auto' - a default action for the target component.

Sets the action the activateTarget should take when this pressable is activated.

Supported actions by component:

ComponentSupported ActionsDefault ('auto')
ClipboardItem'copy''copy'
Anchor to activateTarget
activateTarget
string

ID of a component that should respond to activations (e.g. clicks) on this pressable.

See activateAction for how to control the behavior of the target.

Anchor to appearance
appearance
'monochrome'

Specify the color of the link. monochrome will take the color of its parent.

Anchor to external
external
boolean

Open the link in a new window or tab. If the link points to a domain other than your Storefront, it will always open in a new tab.

string

Unique identifier.

Typically used as a target for another component’s controls to associate an accessible label with an action.

Anchor to language
language
string

Indicate the text language. Useful when the text is in a different language than the rest of the page. It will allow assistive technologies such as screen readers to invoke the correct pronunciation. Reference of values ("subtag" label)

Anchor to onPress
onPress
() => void

Callback when pressed. If to is set, it will execute the callback and then navigate to the location specified by to.

Anchor to overlay
overlay
RemoteFragment

An overlay component to render when the user interacts with the component.

string

Destination to navigate to. You must provide either this property, onPress, or both.

Anchor to toggles
toggles
string

The component's identifier whose visibility will be toggled when this component is actioned.


Add a text link that navigates to an external page. This example displays a link pointing to a sustainability fund URL.

Link to a page

A text link labeled Sustainability fund

Link to a page

import {
reactExtension,
Link,
} from '@shopify/ui-extensions-react/customer-account';

export default reactExtension(
'customer-account.page.render',
() => <Extension />,
);

function Extension() {
return (
<Link to="https://www.shopify.ca/climate/sustainability-fund">
Sustainability fund
</Link>
);
}
import {extension, Link} from '@shopify/ui-extensions/customer-account';

export default extension('customer-account.page.render', (root) => {
const link = root.createComponent(
Link,
{to: 'https://www.shopify.ca/climate/sustainability-fund'},
'Sustainability fund',
);

root.appendChild(link);
});

Navigate to an external page without leaving the current page by opening it in a separate tab. This example shows a link with the external prop for a terms of service page.

Open a link in a new tab

import {
reactExtension,
Link,
} from '@shopify/ui-extensions-react/customer-account';

export default reactExtension(
'customer-account.page.render',
() => <Extension />,
);

function Extension() {
return (
<Link to="https://www.shopify.com/legal/terms" external>
Terms of service
</Link>
);
}
import {extension, Link} from '@shopify/ui-extensions/customer-account';

export default extension('customer-account.page.render', (root) => {
const link = root.createComponent(
Link,
{to: 'https://www.shopify.com/legal/terms', external: true},
'Terms of service',
);

root.appendChild(link);
});

Render a link that inherits its parent's color using the appearance="monochrome" prop. This is useful for links within colored containers or banners.

Use a monochrome link

import {
reactExtension,
Link,
} from '@shopify/ui-extensions-react/customer-account';

export default reactExtension(
'customer-account.page.render',
() => <Extension />,
);

function Extension() {
return (
<Link to="https://www.shopify.com" appearance="monochrome">
Learn more
</Link>
);
}
import {extension, Link} from '@shopify/ui-extensions/customer-account';

export default extension('customer-account.page.render', (root) => {
const link = root.createComponent(
Link,
{to: 'https://www.shopify.com', appearance: 'monochrome'},
'Learn more',
);

root.appendChild(link);
});

  • Use links for navigation: Reserve links for navigation and use buttons for actions.
  • Consider button for standalone links: If the link isn't in a paragraph, consider using a plain button instead for a larger hit area.
  • Use consistently with buttons: Links and buttons include style and accessibility information. Use these components intentionally and consistently to provide a more inclusive experience.

  • Links can't be disabled. If you need a disabled interactive element, use button instead.

Was this page helpful?