Skip to main content
Version: latest
Works everywhere

BaseLink works in both server and client environments. Always use the standard import (e.g. @prokodo/ui/base-link) — the library detects the runtime automatically.

BaseLink

BaseLink is the foundational link primitive in @prokodo/ui. It renders as <a> in server contexts and handles both internal and external navigation. Used internally by Button, Card, and other components that support redirect props.

Live demo →

Overview

import { BaseLink } from "@prokodo/ui/base-link"
;<BaseLink href="/docs/intro" className="my-link">
Read the docs
</BaseLink>

Import

import { BaseLink } from "@prokodo/ui/base-link"

Styling is handled via design tokens — no additional CSS import required.


Props

PropTypeDefaultRequiredDescription
hrefstringDestination URL (from AnchorHTMLAttributes).
targetstringLink target (_blank, etc.) from AnchorHTMLAttributes.
relstringRel attribute from AnchorHTMLAttributes.
linkComponentComponentTypeCustom link component (e.g. Next.js Link).
childrenReactNodeLink content (from AnchorHTMLAttributes).
classNamestringCSS class on anchor element.

See src/components/base-link/BaseLink.model.ts for the full BaseLinkProps type.


WCAG 2.2 Status

CriterionNameStatusNote
1.3.1Info and Relationships (A)✅ FulfilledSemantic structure (headings, lists, labels, landmarks) must be conveyed programmatically via HTML or ARIA.
2.1.1Keyboard (A)✅ FulfilledAll functionality must be operable via keyboard alone, without requiring specific timing.
2.4.4Link Purpose (In Context) (A)🔍 Manual reviewThe purpose of every link must be determinable from the link text alone, or from its surrounding context.
2.4.7Focus Visible (AA)🔍 Manual reviewA visible keyboard focus indicator must be present on every interactive element. Verify against the applied product theme.
2.4.11Focus Not Obscured (Min.) (AA)🔍 Manual reviewThe focused component must not be fully hidden by sticky headers, overlays, or other positioned page elements.
2.5.3Label in Name (A)✅ FulfilledFor components with a visible label, the accessible name must contain or match the visible label text.
4.1.2Name, Role, Value (A)✅ FulfilledName, role, and state of all interactive UI components must be programmatically determinable via native HTML semantics or ARIA.

Test coverage: 4 jest-axe assertion(s) across 5 test file(s) · 2 ARIA attribute occurrence(s) in source scan. Criteria marked 🔍 require manual verification in the final product integration and theme context.

Storybook

👉 Open BaseLink in Storybook


Source

src/components/base-link/BaseLink.model.ts