SLink <s-link>
ts
import { SLink } from 'polaris-vue-elements'Example
vue
<script setup>
import { SLink } from 'polaris-vue-elements'
</script>
<template>
<SLink href="https://polaris.shopify.com" target="_blank">Neutral link</SLink>
<SLink href="https://polaris.shopify.com" target="_blank" tone="critical">Critical link</SLink>
</template>Props
| Prop | Type | Description |
|---|---|---|
accessibilityLabel | string | A label that describes the purpose or contents of the Link. It will be read to users using assistive technologies such as screen readers. Use this when using only an icon or the content of the link is not enough context for users using assistive technologies. |
command | "--auto" | "--show" | "--hide" | "--toggle" | "--copy" | Sets the action the commandFor should take when this clickable is activated. See the documentation of particular components for the actions they support. - --auto: a default action for the target component. - --show: shows the target component. - --hide: hides the target component. - --toggle: toggles the target component. - --copy: copies the target ClipboardItem. |
commandFor | string | ID of a component that should respond to activations (e.g. clicks) on this component. See command for how to control the behavior of the target. |
download | string | Causes the browser to treat the linked URL as a download with the string being the file name. Download only works for same-origin URLs or the blob: and data: schemes. |
href | string | The URL to link to. - If set, it will navigate to the location specified by href after executing the click event. - If a commandFor is set, the command will be executed instead of the navigation. |
interestFor | string | ID of a component that should respond to interest (e.g. hover and focus) on this component. |
lang | 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) |
target | "auto" | "_blank" | "_self" | "_parent" | "_top" | Specifies where to display the linked URL. |
tone | "auto" | "neutral" | "critical" | Sets the tone of the Link, based on the intention of the information being conveyed. |
Events
| Event | Type |
|---|---|
click | CustomEvent |
Listen for these with @click-style listeners on <SLink>.
Slots
| Slot | Description |
|---|---|
default | The content of the Link. |