- Docs
- Components
- 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
// 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.
| Prop | Type | Default | What it does |
|---|---|---|---|
href | string | — | Where it goes. |
tone | "default" | "subtle" | "inherit" | "default" | The link colour, subtle, or the text's. |
external | boolean | false | A new tab: rel="noopener noreferrer", the arrow, and "(opens in a new tab)". |
render | ReactElement | an <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-slot | Element | What 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.
import { Link as RouterLink } from "@tanstack/react-router";
<Link render={<RouterLink to="/users" />}>View all users</Link>