Skip to content

Link

Read the getting started guide or browse the full documentation . For quieter inline links, the subtle variant blends with the text until you hover it.

An inline text link, rendered with a semantic <a>. Violet and underlined by default, with a clear hover and focus treatment.

<script>
import Link from "@invisible-ui/svelte/Link.svelte";
</script>

In Elements:

<ds-link href="/guide">Read the guide</ds-link>
<ds-link href="https://example.com" external>Open the reference</ds-link>
PropTypeDefaultDescription
href *string—Destination URL.
externalbooleanfalseOpen in a new tab (adds target/rel and a trailing arrow icon).
variant"primary" | "subtle""primary"Tone down to the surrounding text colour (still underlined on hover).

Every href is rendered as given: pass only URLs you trust or have sanitized. See Security.

<Link href="/docs">Read the docs</Link>
<Link href="https://example.com" external>External site</Link>
<Link href="/more" variant="subtle">A quieter link</Link>

In React, every other anchor attribute reaches the <a>, and a target="_blank" passed as an attribute gets the safe rel too:

<Link href="https://example.com" external>
External site
</Link>
<Link href="/more" variant="subtle" onClick={track}>
A quieter link
</Link>

Set external for links that open in a new tab — it adds target="_blank" with a safe rel and a trailing arrow icon. Themeable via --ds-link-*.

href is required: a link navigates, and an anchor without a destination is neither focusable nor announced as a link. For an action that stays on the page, use Button, which already carries the button semantics and keyboard behavior. A link still forwards its click, for the work that goes with a navigation such as analytics.