Navigation
Link
Free1.9 KB gzippedAccessible text link. Renders an <a> (or a router link via as) with bold, tuned underlines, tones, external-link handling, optional icons, and a springy arrow for calls to action.
Accessibility: WCAG 2.2 AA · No A or AA violations in light or dark mode · Keys: Enter · Full report
Import
import { Link } from "@vjdesigns/vjdesigns-ui";
Importing only Link adds about 1.9 KB of minified, gzipped JavaScript to your app (React not included). The stylesheet is shared by every component and loaded once: 75.1 KB gzipped.
Examples
Inline
inline links sit in running text and are always underlined, so they don't rely on color.
By continuing you agree to the terms of service and privacy policy.
import { Link, Text } from "@vjdesigns/vjdesigns-ui";
export function Inline() {
return (
<Text style={{ maxWidth: "32rem" }}>
By continuing you agree to the <Link href="#example-inline">terms of service</Link> and{" "}
<Link href="#example-inline">privacy policy</Link>.
</Text>
);
}
Standalone
standalone links stand on their own; arrow adds a nudge on hover for calls to action.
import { Flex, Link, Stack } from "@vjdesigns/vjdesigns-ui";
export function Standalone() {
return (
<Stack gap={3} align="center">
<Link variant="standalone" href="#example-standalone" arrow>
Read the case study
</Link>
<Flex gap={6}>
<Link variant="subtle" href="#example-standalone">
Help
</Link>
<Link variant="subtle" href="#example-standalone">
Status
</Link>
<Link variant="subtle" href="#example-standalone">
Changelog
</Link>
</Flex>
</Stack>
);
}
External
external opens a new tab, adds rel="noopener noreferrer", an icon, and screen-reader text saying so.
import { Link } from "@vjdesigns/vjdesigns-ui";
export function External() {
return (
<Link href="https://www.w3.org/WAI/standards-guidelines/wcag/" external variant="standalone">
WCAG overview
</Link>
);
}
Accessibility
Links in running text are always underlined, so they don't rely on color alone (SC 1.4.1). external opens a new tab and adds an icon plus visually hidden text that warns screen reader users before they leave the page.
Read our accessibility statement, or the WCAG overview (opens in a new tab) from the W3C.
import { Link, Text } from "@vjdesigns/vjdesigns-ui";
export function Accessibility() {
return (
<Text style={{ maxWidth: "34rem" }}>
Read our <Link href="#example-accessibility">accessibility statement</Link>, or the{" "}
<Link href="https://www.w3.org/WAI/standards-guidelines/wcag/" external>
WCAG overview
</Link>{" "}
from the W3C.
</Text>
);
}
Translated
The hidden "opens in a new tab" text is the link's built-in text: translate it with externalLabel. The link text is your own.
Consultez la présentation des WCAG (s'ouvre dans un nouvel onglet).
import { Link, Text, LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import fr from "@vjdesigns/vjdesigns-ui/locales/fr";
export function Translated() {
return (
<LocaleProvider locale="fr" messages={fr}>
<Text>
Consultez la{" "}
<Link href="https://www.w3.org/WAI/standards-guidelines/wcag/fr" external externalLabel="(s'ouvre dans un nouvel onglet)">
présentation des WCAG
</Link>
.
</Text>
</LocaleProvider>
);
}
Right to left
The first example again, inside a right-to-left LocaleProvider (Arabic). Layout, spacing and arrow icons mirror, and the components' built-in text is translated. The example's own text stays in English.
Inline
By continuing you agree to the terms of service and privacy policy.
import { LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import ar from "@vjdesigns/vjdesigns-ui/locales/ar";
// Inline is the "Inline" example above.
<LocaleProvider locale="ar" messages={ar}>
<Inline />
</LocaleProvider>
Usage notes
Target size: inline links in running text are exempt from WCAG 2.5.8; standalone and subtle links have a 24px minimum height.
API reference
Link
| Prop | Type | Default |
|---|---|---|
asComponent or element to render. Defaults to | ElementType | — |
variantVisual style. See | "inline""standalone""subtle" | — |
toneSemantic color. | "neutral""primary""accent""success""warning""danger""info" | — |
sizeFont size. | "sm""md""lg""inherit" | — |
underlineOverrides the variant's underline behavior. Defaults: Warning (WCAG 1.4.1 Use of Color): a link inside running text must be distinguishable by more than color. Don't use | "always""hover""none" | — |
externalOpens in a new tab: adds | boolean | — |
externalLabelScreen-reader text appended to external links. Localize it here. | string | — |
arrowShow a trailing arrow that nudges forward on hover. Best with | boolean | — |
startIconIcon before the label. Built-in | ReactNode | — |
endIconIcon after the label. Built-in | ReactNode | — |
disabledRenders a non-navigating placeholder: a plain | boolean | — |
visitedStyle | boolean | — |
childrenLink content. An icon-only link (no children) requires | ReactNode | — |
aria-label | string | — |
aria-labelledby | string | — |
See what changed in each version in the Changelog.
Accessibility report
Link targets WCAG 2.2 AA. Below: a live axe-core audit of this page's examples, Lighthouse scores for the page in both modes, the accessibility behavior built into the component, and the checks only a person can do.
axe-core audit (live)
Checking the examples above…
Lighthouse audit
Light mode
Score 10035 passed · 0 failed · 30 not applicable · 10 to check by hand
Dark mode
Score 10035 passed · 0 failed · 30 not applicable · 10 to check by hand
Lighthouse 13.5.0 audits the whole docs page (header and sidebar included), not just the examples, in English. Last run 11/27/2026. Some failed audits carry no weight in the score, so a page can score 100 and still list one.
Built-in behavior
Keyboard
| Key | Action |
|---|---|
| Enter | Follows the link. |
Roles and states
| Element | Role | States and properties |
|---|---|---|
<a> | link | aria-disabled when disabled; external adds visually hidden text (externalLabel) warning it opens elsewhere |
Manual checks
Automated tools find roughly a third of accessibility issues. Test these in your app, with your content.
| Check | What to test | WCAG 2.2 |
|---|---|---|
| Keyboard | Every action works with Tab, Shift+Tab, Enter, Space and the arrow keys, and focus never gets stuck. | 2.1.1 (A), 2.1.2 (A) |
| Focus | Focus moves in a logical order, is always visible, and isn't hidden behind sticky headers. | 2.4.3 (A), 2.4.7 (AA), 2.4.11 (AA), 2.4.13 (AAA) |
| Screen readers | Names, roles and states are announced correctly, and status changes are announced without moving focus. | 1.3.1 (A), 4.1.2 (A), 4.1.3 (AA) |
| Color | Meaning never depends on color alone; your own colors meet contrast in both modes. | 1.4.1 (A), 1.4.3 (AA), 1.4.11 (AA), 1.4.6 (AAA) |
| Zoom and reflow | At 200% text size and at 320px wide (400% zoom), nothing is cut off and no sideways scrolling is needed. | 1.4.4 (AA), 1.4.10 (AA), 1.4.12 (AA) |
| Pointer targets | Click and tap targets are at least 24×24px (44×44px for AAA), or spaced so they don't overlap. | 2.5.8 (AA), 2.5.5 (AAA) |
| Motion | Animations respect the reduced-motion setting. | 2.3.3 (AAA) |