Link
A styled anchor with default, muted and nav variants.
<arc-link>Overview
Link styles an anchor in one of three variants. default uses the accent color and underlines on hover. muted starts in the muted text color and turns to the primary text color on hover, for footer links and secondary navigation. nav is 16px (the --text-sm token) with an inline-flex layout and a gap, for menus where links have icons beside them.
Set href and Link renders its own <a>. Or put a single <a> inside it, and Link styles that anchor instead, which works before hydration and without JavaScript. With href, external sets target="_blank" and rel="noopener noreferrer" and adds a 12px external-link icon at 60% opacity. With your own <a>, external adds only the icon, so put target and rel on the anchor yourself.
active colors the link in the accent color to mark the current page. Keyboard focus shows a ring from the --interactive-focus-ring token, and mouse clicks don't.
Guidelines
Do
- Use the default variant for links in body text
- Use the nav variant for navigation menus, sidebars and header link groups
- Set `external` on links that leave your domain
- Set `active` on the current page's link in a navigation list
- Write link text that names the destination, not "click here"
Don't
- Don't use Link for an action that stays on the page. Use Button
- Don't use the muted variant for primary navigation. It's too faint to find your way by
- Don't put block-level elements inside Link. It renders inline
- Don't remove the focus ring without giving keyboard users an equivalent
Features
- Exposes a `link` CSS part. It doesn't apply when you slot your own `<a>`
Preview
Usage
<arc-link><a href="#">Default link</a></arc-link>
<arc-link variant="muted"><a href="#">Muted link</a></arc-link>
<arc-link variant="nav"><a href="#">Nav link</a></arc-link>import { Link } from '@arclux/arc-ui-react';
export default function Example() {
return (
<>
<Link href="#">Default link</Link>
<Link href="#" variant="muted">Muted link</Link>
<Link href="#" variant="nav">Nav link</Link>
</>
);
}<script setup>
import { Link } from '@arclux/arc-ui-vue';
</script>
<template>
<Link href="#">Default link</Link>
<Link href="#" variant="muted">Muted link</Link>
<Link href="#" variant="nav">Nav link</Link>
</template><script>
import { Link } from '@arclux/arc-ui-svelte';
</script>
<Link href="#">Default link</Link>
<Link href="#" variant="muted">Muted link</Link>
<Link href="#" variant="nav">Nav link</Link>import { Component } from '@angular/core';
import { Link } from '@arclux/arc-ui-angular';
@Component({
imports: [Link],
template: `
<arc-link><a href="#">Default link</a></arc-link>
<arc-link variant="muted"><a href="#">Muted link</a></arc-link>
<arc-link variant="nav"><a href="#">Nav link</a></arc-link>
`,
})
export class MyComponent {}import { Link } from '@arclux/arc-ui-solid';
export default function Example() {
return (
<>
<Link href="#">Default link</Link>
<Link href="#" variant="muted">Muted link</Link>
<Link href="#" variant="nav">Nav link</Link>
</>
);
}import { Link } from '@arclux/arc-ui-preact';
export default function Example() {
return (
<>
<Link href="#">Default link</Link>
<Link href="#" variant="muted">Muted link</Link>
<Link href="#" variant="nav">Nav link</Link>
</>
);
}<!-- Auto-generated by @arclux/prism — do not edit manually -->
<!-- arc-link — requires link.css + base.css (or arc-ui.css) -->
<span class="arc-link">
<a
class="link"
href="#"
target=""
rel=""
>
Link
External
</a>
</span><!-- Auto-generated by @arclux/prism — do not edit manually -->
<!-- arc-link — self-contained, no external CSS needed -->
<style>
.arc-link .link:hover { text-decoration: underline;
text-underline-offset: 3px; }
.arc-link[data-variant="muted"] .link:hover { color: rgb(232, 232, 236); }
.arc-link[data-variant="nav"] .link:hover { color: rgb(232, 232, 236);
text-decoration: none; }
.arc-link .link:focus-visible { outline: none;
box-shadow: 0 0 0 2px rgb(3, 3, 7), 0 0 0 4px rgb(77, 126, 247);
border-radius: 2px; }
</style>
<span class="arc-link" style="display: inline">
<a
class="link" style="font-family: 'Host Grotesk', system-ui, sans-serif; font-size: inherit; color: rgb(77, 126, 247); text-decoration: none; cursor: pointer; border: none; background: none; padding: 0"
href="#"
target=""
rel=""
>
Link
External
</a>
</span>API
hrefstring''- URL destination for the link.
variant'default' | 'muted' | 'nav''default'- Link style variant.
defaultuses accent-primary color,muteduses muted text,navuses secondary text with 14px size and flex layout. activebooleanfalse- Active state: applies accent-primary color for navigation highlighting.
externalbooleanfalse- When true, adds
target="_blank"andrel="noopener noreferrer", and renders an external link icon after the text. underline'hover' | 'always' | 'never''hover'- Controls underline behavior: 'hover' underlines on hover, 'always' keeps it visible, 'never' omits it.
See also
- ButtonAction button with three variants for action hierarchy and prefix and suffix slots for icons. For links, slot a real anchor, which works before JavaScript loads.
- BreadcrumbA trail of links from the site root down to the current page.
- Navigation MenuHorizontal navigation bar whose top-level items open dropdowns of links on hover or click. Each link can carry a one-line description.