Skip to content
Vertical Jump Designs-uiFront-End Studio
Get Pro

v3.9 is out.

Navigation

Link

Free1.9 KB gzipped

Accessible 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

tsx
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.

tsx
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.

tsx
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.

tsx
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.

tsx
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.

tsx
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.

tsx
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 props
PropTypeDefault
as

Component or element to render. Defaults to a. Pass a router link (e.g. React Router or Next.js Link) and its props (such as to) are accepted and typed. The component must forward className, style, ref, and ARIA props to its underlying <a>.

ElementType—
variant

Visual style. See LinkVariant.

"inline""standalone""subtle"—
tone

Semantic color. primary (default) uses --color-primary; neutral inherits the surrounding text color; the rest use --color-{tone}-subtle-text. With variant="subtle", the tone color applies on hover.

"neutral""primary""accent""success""warning""danger""info"—
size

Font size. inherit (default) matches the surrounding text.

"sm""md""lg""inherit"—
underline

Overrides the variant's underline behavior. Defaults: inline always, standalone and subtle on hover.

Warning (WCAG 1.4.1 Use of Color): a link inside running text must be distinguishable by more than color. Don't use hover or none on links that sit inside a paragraph; only where layout alone identifies the link.

"always""hover""none"—
external

Opens in a new tab: adds target="_blank", rel="noopener noreferrer" (merged with any rel you pass), an external-link icon, and visually hidden text (externalLabel) so screen reader users are warned.

boolean—
externalLabel

Screen-reader text appended to external links. Localize it here.

string—
arrow

Show a trailing arrow that nudges forward on hover. Best with standalone. Replaced by the external icon when external is set. Flips in RTL.

boolean—
startIcon

Icon before the label. Built-in Icons are decorative by default; it scales with the text.

ReactNode—
endIcon

Icon after the label. Built-in Icons are decorative by default; it scales with the text.

ReactNode—
disabled

Renders a non-navigating placeholder: a plain <a role="link"> with no href, aria-disabled="true", muted styling, and clicks blocked. It is out of the tab order. When as is a router link, a plain <a> is rendered instead, and href, to, target, and rel are dropped.

boolean—
visited

Style :visited links in a distinct color. Off by default (it's usually noise in app UI).

boolean—
children

Link content. An icon-only link (no children) requires aria-label or aria-labelledby.

ReactNode—
aria-labelstring—
aria-labelledbystring—

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)

Running accessibility audit

Checking the examples above…

Lighthouse audit

Light mode

Score 100

35 passed · 0 failed · 30 not applicable · 10 to check by hand

Dark mode

Score 100

35 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

Keyboard
KeyAction
EnterFollows the link.

Roles and states

Roles and states
ElementRoleStates and properties
<a>linkaria-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.

Manual accessibility checks
CheckWhat to testWCAG 2.2
KeyboardEvery 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)
FocusFocus 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 readersNames, 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)
ColorMeaning 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 reflowAt 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 targetsClick 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)
MotionAnimations respect the reduced-motion setting.2.3.3 (AAA)