Skip to content

Link

Get Ritla UI

Links that take people to another page, section or site, inside text or on their own. For actions that change data, use a Button.

Ritla scan of this preview: 41 of 41 checks3 breakpointsScanned

Open in Figma

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add link

    Also works with shadcn: npx shadcn@latest add @ritla/link

  2. Dependencies it brings

    @phosphor-icons/react

  3. Or copy by hand

    Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.

Usage

link.tsx
import { TextLink } from "@/components/ui/link";<p>  By continuing you agree to our <TextLink href="/terms" size="inline">Terms of service</TextLink>.</p><TextLink href="/transactions" size="md">View all transactions</TextLink>

Examples

Styles

brand for most links, neutral where links are quiet (footers, secondary navigation), danger for a link into a destructive flow, never for plain navigation.

EnglishMirroredArabic
LTR →

Sizes

For standalone links: sm 20px, md 24px and lg 28px tall, with 16, 20 and 24px icons.

EnglishMirroredArabic
LTR →

States

Hover and focus come from the pointer and keyboard. disabled drops the href, so the link leaves the Tab order but stays visible. Remove the underline only where the context already reads as links.

EnglishMirroredArabic
LTR →

Inline

size="inline" wraps with the sentence and takes its size and weight, at any text style. Keep the underline in running text: color alone doesn't mark a link.

EnglishMirroredArabic
LTR →

External

external opens a new tab with rel="noopener noreferrer", adds the external arrow and tells screen readers it opens in a new tab, in the page language.

EnglishMirroredArabic
LTR →

With your router

Pass Next's <Link> (or your router's) as render: it keeps client-side navigation and prefetching, and TextLink adds the look.

EnglishMirroredArabic
LTR →

With an arrow

arrow adds a trailing arrow that points to the destination (left in Arabic) and nudges toward it on hover and focus. For standalone links such as “Read the guide”, not inside running text.

EnglishMirroredArabic
LTR →

API reference

TextLink

Also takes every <a> prop. Named TextLink so it doesn't clash with your router's Link.

PropTypeDefaultDescription
childrenReactNodeNoneFigma's Label.
hrefstringNoneWhere the link goes.
tone"brand" | "neutral" | "danger""brand"Figma's Tone.
size"sm" | "md" | "lg" | "inline""lg"Figma's Size, or inline inside running text.
underlinebooleantrueFigma's Show underline.
iconLeadingIconComponentNoneFigma's Icon leading and its swap. Directional icons mirror in RTL.
iconTrailingIconComponentNoneFigma's Icon trailing and its swap.
arrowbooleanfalseFigma's Arrow: a trailing arrow that points to the destination and nudges toward it on hover and focus.
externalbooleanfalseA new tab, the external arrow and a screen reader note.
disabledbooleanfalseFigma's State = Disabled: no href, out of the Tab order.
renderReactElementNoneA router link (<Link href>) rendered with the TextLink look.

Accessibility

Keyboard

Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.

KeyAction
TabMoves focus to the link, with the focus ring around it (the error ring on danger).
EnterFollows the link.

ARIA

  • A real <a href>, so it's announced as a link and opening in a new tab or copying works.
  • An external link adds “(opens in a new tab)” for screen readers, in Arabic on Arabic pages.
  • A disabled link has aria-disabled="true" and no href, so Tab skips it.
  • Icons are decorative and hidden from screen readers; the text names the link.

Arabic and RTL notes

Mirrors

  • Directional icons mirror: the “View all transactions” arrow points left, and the external arrow up and to the left.
  • The leading icon sits at the inline start (the right), the trailing one at the end.

Does not mirror

  • Non-directional icons (home, help) stay as they are, as does the underline.
Numerals
Numbers in a link's text follow numerals like any other text.
Arabic typography
Standalone links use the label styles in Medium, with taller Arabic line heights; heights are minimums, so text never clips. The underline sits 4px below the baseline, clear of most Arabic dots.
Mixed-direction text
Inside a sentence the link follows the paragraph direction. Wrap a Latin brand name inside an Arabic link in <bdi>.

Checks it passes

The Ritla checks this component satisfies by construction. Used as documented, it does not bring these defects onto your page.

  • R050Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
  • R051letter-spacing applied to Arabic text (breaks the connected script)
  • R042Clipped text: content wider than its box with overflow hidden and no ellipsis
  • R043Fixed-pixel-width container whose Arabic text exceeds the space