Migrate Link to the Polaris link component
The Polaris link component makes text interactive for navigation and link-triggered actions. It replaces the previous Link component and is available as <s-link> in API versions 2025-10 and newer.
Anchor to Updated propertiesUpdated properties
The following properties are different in the Polaris link component.
The previous Link to prop is now called href.
target defaults to 'auto', which automatically opens external links in a new window so customers stay on the current page — no extra code needed. Set target="_blank" only when you want to force an internal link to open in a new window.
Anchor to languagelanguage
The previous Link language prop is now called lang.
Anchor to appearanceappearance
The previous Link appearance prop is now called tone.
| Previous value | New value | Migration notes |
|---|---|---|
'monochrome' | Removed | monochrome is no longer available and doesn't have a direct replacement. |
| N/A | 'auto' | auto is a new tone value. The link color is contextualized based on where it's rendered, and it might appear monochrome in subdued text. |
| N/A | 'neutral' |
Migrating appearance to tone
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return (
<s-link href="/terms" tone="auto">
Terms and conditions
</s-link>
);
}Pre-Polaris (2025-07)
import {
reactExtension,
Link,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return (
<Link to="/terms" appearance="monochrome">
Terms and conditions
</Link>
);
}Anchor to onPresson Press
The previous Link onPress prop is now called onClick.
Migrating onPress to onClick
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return <s-link onClick={() => console.log('Clicked')}>Learn more</s-link>;
}Pre-Polaris (2025-07)
import {
reactExtension,
Link,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return <Link onPress={() => console.log('Clicked')}>Learn more</Link>;
}Anchor to externalexternal
The previous Link external prop has been replaced with target.
| Previous pattern | New pattern |
|---|---|
external={true} | target="_blank" |
external={false} or omitted | target="auto" or omitted |
Anchor to New propertiesNew properties
The Polaris link component introduces the following new properties:
| New prop | Type | Description |
|---|---|---|
command | '--auto', '--toggle', '--copy', '--show', '--hide' | Sets the action to run when the link is activated. |
commandFor | string | Sets the ID of the target component for the command. |
interestFor | string | Sets the ID of the component that should respond to hover and focus. |
target | '_blank' | 'auto' | Controls where the link opens. |
Anchor to Removed propertiesRemoved properties
The previous Link activateAction and activateTarget props have been replaced with command and commandFor.
| Previous pattern | New pattern | Migration notes |
|---|---|---|
activateAction="copy" + activateTarget="promo-code" | command="--copy" + commandFor="promo-code" | Copy behavior now uses the command pattern. |
Migrating activateAction to command
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return (
<>
<s-link command="--copy" commandFor="promo-code">
Copy promo code
</s-link>
<s-clipboard-item id="promo-code" text="SAVE20"></s-clipboard-item>
</>
);
}Pre-Polaris (2025-07)
import {
ClipboardItem,
reactExtension,
Link,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return (
<>
<Link activateAction="copy" activateTarget="promo-code">
Copy promo code
</Link>
<ClipboardItem id="promo-code" text="SAVE20" />
</>
);
}Anchor to overlayoverlay
The Polaris link component no longer supports overlay directly. To open a modal overlay, use commandFor with command and target s-modal.
Migrating overlay to commandFor
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return (
<>
<s-link command="--show" commandFor="details-modal">
View details
</s-link>
<s-modal id="details-modal" heading="Order details">
<s-text>Your order includes free shipping on all items.</s-text>
</s-modal>
</>
);
}Pre-Polaris (2025-07)
import {
Link,
Modal,
Text,
reactExtension,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return (
<Link
overlay={
<Modal title="Order details">
<Text>Your order includes free shipping on all items.</Text>
</Modal>
}
>
View details
</Link>
);
}Anchor to togglestoggles
The previous Link toggles prop was used to expand or collapse content in Disclosure. In Polaris, use s-details with s-summary for expandable content instead of a link trigger.
| Previous value | New pattern |
|---|---|
toggles="shipping-details" | Use <s-details> with <s-summary> and place the expandable content inside. |
Migrating toggles to details
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return (
<s-details>
<s-summary>View shipping details</s-summary>
<s-text>Ships within 3 to 5 business days.</s-text>
</s-details>
);
}Pre-Polaris (2025-07)
import {
reactExtension,
Disclosure,
Link,
Text,
View,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return (
<Disclosure>
<Link toggles="shipping-details">View shipping details</Link>
<View id="shipping-details">
<Text>Ships within 3 to 5 business days.</Text>
</View>
</Disclosure>
);
}