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.
Import
Section titled “Import”<script> import Link from "@invisible-ui/svelte/Link.svelte";</script><script setup> import { Link } from "@invisible-ui/vue";</script>import { Link } from "@invisible-ui/react";<script type="module"> import "@invisible-ui/elements/define";</script>
<ds-link></ds-link>In Elements:
<ds-link href="/guide">Read the guide</ds-link><ds-link href="https://example.com" external>Open the reference</ds-link>| Prop | Type | Default | Description |
|---|---|---|---|
href * | string | — | Destination URL. |
external | boolean | false | Open 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). |
| Prop | Type | Default | Description |
|---|---|---|---|
href * | string | — | Destination URL. |
external | boolean | false | Open in a new tab (adds target/rel and a trailing arrow icon). |
variant | LinkVariant | "primary" | Tone down to the surrounding text colour (still underlined on hover). |
Slots: default.
| Prop | Type | Default | Description |
|---|---|---|---|
href * | string | — | Destination URL, used as given. |
external | boolean | false | Open in a new tab: adds target and a safe rel, and a trailing arrow. |
variant | LinkVariant | "primary" | subtle takes the surrounding text colour (still underlined on hover). |
children | ReactNode | — | The link text. |
Also accepts Omit< ComponentPropsWithoutRef<"a">, "href" | "children" | "className" >.
| Attribute | Reactive | Description |
|---|---|---|
href * | yes | |
external | yes | |
variant | yes | primary|subtle |
Reactive attributes re-render the element when they change after the first render.
Every href is rendered as given: pass only URLs you trust or have
sanitized. See Security.
Example
Section titled “Example”<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.