Skip to content
Pixelbits
Docs / Text link
Core

Text link

A text link. All native anchor props (href, target, rel…) are passed through. Named TextLink so it never clashes with Next.js Link: use both together with asChild.

Installation

npm: import
import { TextLink } from "pixelbits/text-link";
shadcn: copy the source
npx shadcn add https://pixelbits.ali-moradi-develop.com/r/text-link.json

API

<TextLink>

A text link. All native anchor props (href, target, rel…) are passed through. Named TextLink so it never clashes with Next.js Link: use both together with asChild.

Example
<TextLink href="/docs">Read the docs</TextLink>
<TextLink variant="pixel" asChild><Link href="/about">About</Link></TextLink>
PropTypeDefaultDescription
variant"underline" | "pixel" | "plain""underline"

Decoration.

  • "underline": a quiet underline that turns to the accent on hover.
  • "pixel": a hairline that fills in eight pixel steps on hover or focus.
  • "plain": no decoration (navigation, cards); color changes on hover.
asChildbooleanfalse

Render the only child element (for example Next.js <Link>) with the link styles instead of an <a>.

Also accepts every prop of AnchorHTMLAttributes<HTMLAnchorElement>.