Tinyrack

Link

Navigation with semantic color and underline behavior while preserving native anchor capabilities.

Contract

AxisValuesDefault
variantdefault, muted, dangerdefault
underlinealways, hover, nonehover
disabledblocks pointer and keyboard navigationfalse

Install

pnpm add @tinyrack/ui

Scroll inside the code area to read long lines.

Styles

@import '@tinyrack/ui/components/link.css';

Scroll inside the code area to read long lines.

Imports

import { TRLink } from '@tinyrack/ui/components/link';

Scroll inside the code area to read long lines.

Playground

Usage

Examples

API

Use TRLink for navigation and TRButton for commands. Enter activates an enabled link; Space scrolls like a native anchor. Disabled links expose aria-disabled, remove their native destination and tab stop, and suppress pointer, keyboard, and programmatic activation. External links should disclose a new browsing context in visible text and pair target="_blank" with an appropriate rel.

PropType / defaultPurpose
hrefnative anchor hrefSets the destination; omitted while disabled.
variantdefault | muted | danger / defaultSelects semantic text color.
underlinealways | hover | none / hoverSelects underline visibility.
disabledboolean / falsePrevents navigation and removes the link from sequential focus.
renderBase UI render element or callbackComposes React Router or another link component without nested anchors.
native propsanchor attributes, events, className, style, refForwards current state, external/download attributes, handlers, styles, and the React 19 ref.

Style tokens

--tr-link-color, --tr-link-font-weight, --tr-link-decoration-thickness, --tr-link-underline-offset, --tr-link-hover-opacity, --tr-link-disabled-opacity, --tr-link-radius, --tr-link-focus-color, --tr-link-focus-width, --tr-link-focus-offset, and --tr-link-duration customize the component while retaining Tinyrack token fallbacks.