Edit in GitHubLog an issue

sp-link

Since: UXP 4.1, PS 22.0.0

Renders a link, that when clicked can launch a webpage in the user's default browser.

Links

See:

Example

Copied to your clipboard
<sp-link href="https://adobe.com">Adobe</sp-link>

Variations#

Over Background#

Copied to your clipboard
<sp-link variant="overBackground">This link has more contrast, suitable for rendering over a colored background.</sp-link>

Quiet#

Copied to your clipboard
<sp-link quiet>This is a quiet link</sp-link>

Responding to events#

You can respond to a click on the link using the click event. However, you cannot prevent the navigation to the URL specified by href. If the href attribute is not specified, no browser will be launched.

Copied to your clipboard
1document.querySelector(".yourLink").addEventListener("click", evt => {
2 console.log("You clicked a link");
3})
Copyright © 2021 Adobe. All rights reserved.