Link
Alignment target:@astryxdesign/core v0.7.1 · Link
<Link
href="/guide/getting-started"
color="accent"
>
Read the docs
</Link>Props #
| Name | Type | Default | Description |
|---|---|---|---|
href | string | - | Link URL. When omitted, the component renders as a <button>. |
as | LinkRoot | - | Root used instead of <a> when the link has an address and is enabled. It receives href and to. |
label | string | - | Accessible name. Use it when the visible content is not the name, such as an icon-only link. It replaces the link text for assistive technology. |
newTabLabel | string | Localized “(opens in new tab)” | Screen-reader text after an external link. |
size | LinkSize | - | Font size, the same steps as body text: sm, md, lg, xl. |
weight | LinkWeight | - | Font weight. normal is the same as regular. |
maxLines | number | 0 | Maximum visible lines. 0 does not truncate. |
isExternalLink | boolean | false | Whether the link opens in a new tab and shows an external indicator. |
hasUnderline | boolean | false | Whether the underline is always visible. |
color | LinkColor | 'accent' | Link color. Optional: primary, secondary, accent, inherit. |
isDisabled | boolean | false | Whether the link is disabled. It cannot navigate or emit click, keeps its Tab stop, and is announced as disabled. A caller role or aria-disabled does not replace that; a caller tabindex still applies. |
target | string | - | HTML target attribute. |
rel | string | - | HTML rel attribute. External links automatically add noopener noreferrer. |
download | string | boolean | - | Triggers a download of the linked URL. A string is the suggested filename. true renders a bare download attribute, false renders no attribute at all. |
referrerPolicy | string | - | Referrer policy for the link, forwarded as the referrerpolicy attribute. |
Events #
| Name | Description |
|---|---|
click | Emitted on click. Not emitted when disabled. |
Slots #
| Name | Description |
|---|---|
default | Link text content. |
Native attributes #
The root element is an <a>, a <button>, or the component passed to as. A disabled link is always an <a> without an address.
The following are passed to the root element:
- HTML attributes.
aria-*attributes.data-*attributes.data-coloralways reflectscolor, so a caller value does not replace it.class.style.