Edit in GitHubLog an issue

sp-link

Since: UXP v4.1

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})
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2023 Adobe. All rights reserved.