Link
A styled anchor element with variants, underline control, and external link support.
Live Sandbox
This is a hydrated playground for the component. Toggle "Live preview" on the block below to swap the static HTML render for a real Livewire instance — every prop in the component's sandbox schema becomes an editable form field inside the iframe, so you can try different prop combinations live without writing any local code.
Basic Usage
Variants
External Links
External links automatically get target="_blank", rel="noopener noreferrer", and a small arrow icon.
Underline Styles
In Context
Read the getting started guide to learn how to install WireKit in your project.
Link styled as a button
Use as="button" for an action that should look like a link but be a real <button> — accessible and keyboard-operable, without a fake href="#".
Props
| Prop | Type | Default | Description |
|---|---|---|---|
href |
string|null | null |
Link URL |
variant |
string | 'default' |
Color: default, subtle, muted |
external |
bool | false |
Opens in new tab with rel="noopener noreferrer" and external icon |
underline |
string | 'always' |
Underline behavior: always, hover, none |
as |
string | 'a' |
HTML element to render |
scope |
string|null | null |
Scoped personalization name |
Accessibility
External links include an inline SVG icon with aria-hidden="true" to indicate they open in a new window. The rel="noopener noreferrer" attribute prevents the opened page from accessing the original window.
Keyboard Interaction
| Key | Action |
|---|---|
Tab |
Move focus to the link |
Enter |
Activate the link (follow the URL) |
Pitfalls
- Don't add
rel="noopener"manually ontarget="_blank"links. WireKit auto-injectsrel="noopener noreferrer"for_blank(CVE-class tabnabbing fix). Manualrelvalues are merged correctly, but it's redundant. - Don't use
<x-wirekit::link>for purely decorative anchors. It carries focus styles + a screen-reader hint for_blanktargets — overhead for invisible navigation. A plain<a>is fine for those.
Design Tokens
| Token | Used for |
|---|---|
--font-wk-sans |
Link font family |
--color-wk-accent |
default variant link color |
--color-wk-text-subtle |
subtle variant link color |
--color-wk-text-muted |
muted variant link color |
--transition-wk-duration / --transition-wk-easing |
Hover transition |
Usage & Conventions
Prop conventions — this component uses one or more of the shared semantic prop names (
intent/variant/tone/surface). See Prop naming conventions for the canonical vocabulary, alias matrix, and decision tree.