Tinyrack

LinkButton

Navigation that looks like a button, rendered as a real anchor with six intents, three appearances, and three sizes.

Contract

AxisValuesDefaultUse
intentneutral, primary, info, success, warning, dangerneutralCommunicates the purpose or outcome of the destination.
appearancesolid, outline, ghostsolidChanges visual emphasis without changing intent.
uiSizemd, lgmdMatches the size of surrounding controls.
disabledbooleanfalseRemoves the destination and blocks navigation.

Install

pnpm add @tinyrack/ui

Scroll inside the code area to read long lines.

Styles

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

Scroll inside the code area to read long lines.

Imports

import { TRLinkButton } from '@tinyrack/ui/components/link-button';

Scroll inside the code area to read long lines.

Playground

Usage

Examples

API

Use TRLinkButton for navigation that looks like a button, and TRButton for commands. It renders a real anchor with role="link", so Enter activates it, Space scrolls like a native anchor, and native href, target, rel, and download all work. Disabled link buttons expose aria-disabled, remove their href and tab stop, and suppress pointer and keyboard activation. External destinations should disclose a new browsing context in visible text and pair target="_blank" with an appropriate rel.

PropType / defaultPurpose
intentneutral | primary | info | success | warning | danger / neutralSelects the semantic meaning and color role.
appearancesolid | outline | ghost / solidSelects visual emphasis without changing the intent.
uiSizemd | lg / mdSelects the control size.
disabledboolean / falseRemoves the destination and blocks navigation.
hrefnative anchor hrefSets the destination; omitted while disabled.
renderBase UI render element or callbackComposes React Router or another link component without nested anchors.
native propsanchor attributes, events, className, style, refForwards external and download attributes, handlers, styles, and the React 19 ref.

TRLinkButton reuses the TRButton styling contract (the tr-btn class with data-appearance, data-intent, and data-ui-size), so it stays visually identical to a button while keeping link semantics.