Skip to main content

Link

Link makes text interactive so customers can perform an action, such as navigating to another location.

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.

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

Extract<, 'monochrome'>

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

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.

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)

() => void

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

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.

string

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

Was this section helpful?

Basic Link

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

export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);

function Extension() {
return (
<Link to="https://www.shopify.ca/climate/sustainability-fund">
Sustainability fund
</Link>
);
}

Preview

ValueDescription
"monochrome"Takes the color of its parent.
Was this section helpful?

  • If the link isn’t in a paragraph, then consider using a plain button instead for a larger hit area.

  • Use links primarily for navigation and use buttons primarily for actions.

  • The HTML that renders for the Button and Link components includes style and accessibility information. Use these components intentionally and consistently to provide a more inclusive experience for assistive technology users and a more cohesive visual experience for sighted users.

Was this section helpful?