Skip to main content
  1. Docs
  2. Components
  3. Type

Link

Navigation to a page, a section, a file or a site. An action that changes data is a Button.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<a>Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Import

link.tsx
// From the package: a build keeps only what it uses.
import { Link } from "@qeetrix/react";

// Or from its own path.
import { Link } from "@qeetrix/react/link";

02

Props

And every native attribute of the element it renders.

PropTypeDefaultWhat it does
hrefstring—Where it goes.
tone"default" | "subtle" | "inherit""default"The link colour, subtle, or the text's.
externalbooleanfalseA new tab: rel="noopener noreferrer", the arrow, and "(opens in a new tab)".
renderReactElementan <a>A router link: render={<RouterLink to="/x" />}; or a <button />, an action in place that reads as a link.
messages{ external }"(opens in a new tab)"Server-safe, so the provider's strings don't reach it: pass the translation here.

03

Parts

Each part carries a data-slot, for tests and placement.

data-slotElementWhat it is
link<a>data-tone; data-external.
link-icon<svg>The external arrow, aria-hidden.

04

With your router

render takes your router's link; the look stays.

nav-link.tsx
import { Link as RouterLink } from "@tanstack/react-router";

<Link render={<RouterLink to="/users" />}>View all users</Link>
Next — LinkAccessibility