Link
Styled hyperlink with classless defaults, automatic new-window and file-type indicator icons, and a reset decoration for a link that should inherit its surroundings instead.
Usage
When to use
- Any anchor tag inside body content. A plain
<a>picks up the design system treatment. - When the consumer wants external, new-window, or file-type indicators to appear automatically from attribute selectors
- When a specific link should opt out of the automatic indicator icon - add
.plain - When a link should drop link styling entirely and inherit the surrounding text, such as a brand name in a header - add
.reset
When not to use
- As a call-to-action - use the
buttoncomponent with a link appearance - Inside a navigation menu -
navbarandsidenavbring their own link treatment - Inside a linklist - the
linklistcomponent overrides link styling for its rows
Do
- Make the link text describe the destination so the link makes sense out of context
- Provide an
aria-labelthat includes "opens in new tab" ontarget="_blank"links when the visible text does not already say so
Don't
- Use "click here" or "read more" as link text
- Rely on color alone to indicate a link - the underline is part of the affordance
API
Slots
| Slot | Required | Description |
|---|---|---|
content | Yes | Visible link text. |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
url | string | # | href value for the anchor. |
is_current | boolean | - | Adds aria-current="page" for the active or current link. |
classes | array | - | Additional CSS class words merged into the root element. |
attributes | object | - | Additional HTML attributes spread on the root element. |
Classes
| Class | Capability | Default | Description |
|---|---|---|---|
.subtle | Emphasis | - | Lower emphasis; a muted, quieter weight. |
.neutral | Emphasis | Yes | Default emphasis; the standard weight at balanced contrast. |
.accent | Emphasis | - | Higher emphasis; a stronger, louder weight. |
.info | Intent | - | Informational message. |
.warning | Intent | - | Warning or caution. |
.danger | Intent | - | Error, destructive, or critical. |
.success | Intent | - | Confirmation or completion. |
.sm | Size | - | Small. |
.md | Size | Yes | Medium. |
.lg | Size | - | Large. |
.plain | Decoration | - | plain suppresses the automatic new-window and file-type indicator icons; reset drops the link color, underline, background and transition so the link inherits the surrounding text. |
.reset | Decoration | - | plain suppresses the automatic new-window and file-type indicator icons; reset drops the link color, underline, background and transition so the link inherits the surrounding text. |
Examples
Active page
Active link using aria-current="page".
Reset
.reset drops the link color, underline, background and transition, so the link reads as the text around it.
In body
Links inside running prose, where the underline and the visited color have to hold against the surrounding text.
Accessibility
- WCAG 2.2 AA
- Link color meets contrast on both schemes; visited color also meets contrast.
- Visible focus ring on keyboard focus
- The automatic new-window and file-type indicator icons are decorative - rendered via
::afterandmask-image, so screen readers ignore them. Pair a truly important external link with a visible-text cue (oraria-label) rather than relying on the icon alone.