Link
A link takes people to another place: a page, a section, a file, an email address, or a phone number.
When to use
- Inline, for a destination named inside a sentence: "By continuing you agree to the privacy notice."
- Standalone, for a link on its own line, after a short prompt, or in a list: "See all 15 jobs", "How it works", a contact line.
- Title link, for the name of a card, row, or table entry that opens it; stretched, it makes a whole card clickable.
- Skip link, the first focusable element of every page.
When not to use
| Need | Use instead |
|---|---|
| An action that changes something here (save, copy, sign out, retry) | Button; the text button for low emphasis. Only an action that opens something on the same page and sits among links ("Report" beside "Never pay to apply", a task tile that opens "Get help") keeps the link's look on a <button> (see Behavior) |
| The page's main call to action | A link styled as a button: <a class="oa-btn oa-btn--filled"> (Button) |
| Header, footer, tab, breadcrumb, and back links | Site header, Footer, Tabs, Breadcrumb |
| A ready-made search ("Jobs in Lebanon") | A suggestion chip |
| A link that cannot be followed yet | No link at all: remove the href and render the text. A link is never disabled. |
Anatomy
Inline link:
- Text, underlined, in the link color, weight 600.
- New-tab cue (only when it opens one):
north_eastand a visually hidden "(opens in a new tab)".
Standalone link:
- Box,
inline-flex, at least 48px tall, its focus ring a pill. 8px of inline padding keeps the ring clear of the text, and an equal negative margin keeps the label on the column's edge. - Label,
.oa-link__label, underlined (the underline sits on the label so it never runs under the icon glyph). - Icon,
.oa-link__icon: a trailing arrow or a leading contact icon, never both. - New-tab cue, as above.
Title link:
- Heading text in the heading's color, underlined on hover.
- Stretched
::after(oa-title-link--stretched) covering the card: the target and the focus ring.
Variants
| Variant | Class | Use for | Color | Underline |
|---|---|---|---|---|
| inline | oa-link |
Inside running text | --oa-link, default --color-primary-ink (text-primary-ink) |
Always: thickness auto, offset 4px; 2px on hover |
| standalone | oa-link oa-link--standalone |
Its own line, lists, prompts, contact lines | as inline | On the label, as inline |
| title | oa-title-link |
Names of cards, rows, and table entries | The heading's own color | None until hover |
| stretched title | oa-title-link oa-title-link--stretched |
The one link of a clickable card | The heading's own color | None until hover; the card hovers too |
| on an inverse band | any of the above inside .oa-panel--inverse |
The inverse band, and the CTA band built on it | --color-inverse-primary, set by the band |
as the variant |
| skip link | oa-skip-link (base.css) |
The first focusable element of every page | --color-surface on --color-on-surface |
None |
- Containers re-point the color, links never do. Inverse bands set
--oa-linkand--color-focus-ringto--color-inverse-primary; banners and page strips set--oa-link: currentColor, so a link takes the banner's on-color (canonical §2.8, §10.22, D-ARC-07). - There is no visited color (D-CAI-08).
Sizes
| Kind | Height | Padding | Type style | Icon |
|---|---|---|---|---|
| Inline | the line; no minimum | none | The sentence's style at weight 600 (font-semibold) |
north_east for a new tab only: oa-icon--md (20px) beside 14–16px text |
| Standalone | at least 48px, --size-touch-target (min-h-12) |
8px inline, --space-2 (px-2), offset by an equal negative margin (-mx-2) so the label stays on the column's edge |
The context's: it takes the size of the text around it (canonical §10.3) | 20px (oa-icon--md) beside 16px text, 18px (oa-icon--sm) beside 14px text |
| Title | the heading's line | none | title-md on cards, title-sm in list rows |
none |
| Skip link | at least 48px | 12px × 20px | label-lg |
none |
The icon sits 8px from the label (--space-2) (D-CAI-08, D-ARC-22).
Tokens
| Part | Property | Token (Tailwind) |
|---|---|---|
| Inline, standalone | color | --oa-link, default --color-primary-ink (text-primary-ink) |
| Inline, standalone | weight | --font-weight-semibold (font-semibold) |
| Inline, standalone | underline | offset 4px (underline underline-offset-4), 2px on hover (hover:decoration-2) |
| Inline, title | ring corner | --radius-8px (rounded-8px) |
| Standalone | box | --size-touch-target (min-h-12), gap --space-2 (gap-2), inline padding --space-2 with an equal negative margin (px-2 -mx-2), ring corner --radius-full |
| Standalone | icon | --size-icon-md or --size-icon-sm |
| Stretched title | ring corner | --radius-card (rounded-card) |
| Focus | ring | --size-focus-ring solid --color-focus-ring, --size-focus-offset |
| Inverse band | color and ring | --color-inverse-primary (text-inverse-primary) |
| Skip link | box | --color-on-surface, --color-surface, --z-skip-link (z-80), --text-label-lg, --size-touch-target |
States
| State | What changes |
|---|---|
| Enabled | Underlined, in the link color. Title links have no underline. |
| Hover | Pointer devices only. Inline and standalone links: the underline thickens to 2px. Title links: the underline appears. Links take no state layer (canonical §2.7). |
| Focus-visible | The base ring. Inline and title links: 8px corners. Standalone links: a pill, held clear of the first and last glyphs by the 8px inline padding. Stretched title links: the ring moves to the card-sized ::after and follows the card's corner. |
| Pressed | No layer on text links. A clickable card shows its own 12% layer (Card). |
| Visited | No change. |
| Disabled | Does not exist. Remove the href and render text. |
| Current page | Navigation components mark it with [aria-current="page"]; plain links do not. |
Behavior
Links navigate. Enter follows them. Never script a link into a button, and never put
role="button"on one (canonical §10.0).New tabs only when needed: a privacy notice opened from inside a form, another product. Write
target="_blank" rel="noopener", thenorth_easticon, and the visually hidden "(opens in a new tab)" in the page language (D-CAI-08, D-BCP-34).Stretched title links. One link per card: the title. Its
::aftercovers the card, which isposition: relative; other controls on the card (save, more) sit above it withposition: relativeandz-index: var(--z-raised)and keep their own names. Never a link inside a link, and never a card-sized<a>(canonical §10.10, D-CSN-04). The title link isinline-block, so its own box keeps the heading's line height.Buttons drawn as links.
oa-link,oa-link--standalone,oa-title-link, andoa-title-link--stretchedalso go on<button type="button">: the reference CSS drops the button's own margin, padding, border, and fill and keeps the link's color, weight, underline, ring, and target. The element stays a button, with its name andaria-haspopup="dialog"where it opens one, because it acts on the page and goes nowhere (canonical §10.0, D-CAI-01). Use it only for an action that opens a dialog, a sheet, or a disclosure on the same page and sits where links sit; a button does not wrap inside a sentence, so write it as its own standalone line, never as an inline link in running text.Contact links:
tel:with the E.164 number (tel:+96171214723) shown as "+961 71 214 723",mailto:with the address; the value isdir="ltr"(canonical §14.3).Files: name the type and size: "Download the guide (PDF, 1.2 MB)" (canonical §12.3).
Skip link: the first element of
<body>, pointing to<main id="main" tabindex="-1">. It waits above the window and comes down when focused: fixed 12px from the top and 16px from the inline start, plus the top and start safe-area insets (--oa-safe-top,--oa-safe-start), on the top layer (--z-skip-link, 80), a 48pxon-surfacepill withsurfacetext inlabel-lg, plus the ring. Build it as its own class, never from a screen-reader-only utility and its undo, which loses the padding (C-2, D-CSN-49, D-ARC-26). The page structure:<body> <a class="oa-skip-link" href="#main">Skip to content</a> <!-- header --> <main id="main" tabindex="-1">…</main> </body>
Accessibility
- Element. Always
<a href>. The name is the link text, which names the destination (canonical §12.3, §13). - Not by color alone. Links in sentences are always underlined (WCAG 1.4.1).
- Targets. Inline links in running text are exempt from the 48px target (WCAG 2.5.8) and get no minimum height, so line spacing stays even. Standalone links are at least 48px tall (D-LAY-12, D-CAI-08).
- Contrast.
primary-inkis 5.45:1 or more on every surface, container, and pastel, light (#8f4200) and dark (#ffb68a);inverse-primaryis 7.74:1 on the inverse surface. The ring is 5.45:1 or more, and 7.74:1 once an inverse band re-points it (canonical §2.8, §2.13). - New tabs are announced by the hidden text.
- Skip link meets WCAG 2.4.1 on every page;
<main>takes focus without showing a ring when the script moves focus there. - Forced colors. Underlines and outlines survive; the stretched link's own outline turns transparent, which forced colors draw as well.
RTL and languages
- Arrows take
oa-icon--mirror(arrow_forward,north_east); contact icons (call,mail) do not mirror (canonical §8.3). - Phone numbers, email addresses, and URLs stay left to right:
dir="ltr"on the label,<bdi dir="ltr">inside Arabic sentences (canonical §14.2). - Arabic: "بالمتابعة فإنك توافق على إشعار الخصوصية." French: "En continuant, vous acceptez l’avis de confidentialité." (Global ID).
| English | Arabic | French |
|---|---|---|
| (opens in a new tab) | (يُفتح في نافذة جديدة) | (s’ouvre dans un nouvel onglet) † |
| Skip to content | الانتقال إلى المحتوى | Aller au contenu † |
| Privacy notice | إشعار الخصوصية | Avis de confidentialité |
† Needs native review before release (canonical §12.3).
Content
- The text names the destination: "Read the privacy notice", "See all 15 jobs", "How it works", "Explore Global ID", "Never pay to apply". Never "here", "more", "learn more", or "click here" (D-BCP-21).
- Links to other sites or products name them ("Explore Global ID").
- Sentence case. The sentence's full stop stays outside the link.
- "Clear filters" is a text link, not a button (canonical §8.4).
Do and don't
| Do | Don't |
|---|---|
| "Read the privacy notice" | "Click here to read our policy" |
| Underline every link in running text. | Rely on the orange color alone. |
Let .oa-panel--inverse re-point --oa-link (reference CSS), or write text-inverse-primary on the band's links (Tailwind). |
Keep primary-ink links inside the band: 1.85:1 on the inverse surface. |
| One stretched title link per card, other controls raised above it. | A card wrapped in one big <a>, or a link inside a link. |
north_east and "(opens in a new tab)" for a new tab. |
Opening new tabs by default, or without telling. |
| A 48px standalone link with an arrow. | A 48px minimum height on links inside sentences. |
| "Skip to content" with its own class. | A 116×24 skip link built from screen-reader utilities. |
Code
HTML (reference CSS)
Inline, standalone, and contact links, from reference/snippets/actions.html:
<p class="oa-text-body-lg">By continuing you agree to the <a class="oa-link" href="#privacy">privacy notice</a>.</p>
<a class="oa-link oa-link--standalone" href="#jobs"><span class="oa-link__label">See all 15 jobs</span><span class="oa-icon oa-icon--md oa-icon--mirror oa-link__icon" aria-hidden="true" translate="no">arrow_forward</span></a>
<a class="oa-link oa-link--standalone" href="#explore-global-id" target="_blank" rel="noopener"><span class="oa-link__label">Explore Global ID</span><span class="oa-icon oa-icon--md oa-icon--mirror oa-link__icon" aria-hidden="true" translate="no">north_east</span><span class="oa-visually-hidden">(opens in a new tab)</span></a>
<a class="oa-link oa-link--standalone" href="tel:+96171214723"><span class="oa-icon oa-icon--md oa-link__icon" aria-hidden="true" translate="no">call</span><span class="oa-link__label" dir="ltr">+961 71 214 723</span></a>
<a class="oa-link oa-link--standalone" href="mailto:info@oait.app"><span class="oa-icon oa-icon--md oa-link__icon" aria-hidden="true" translate="no">mail</span><span class="oa-link__label" dir="ltr">info@oait.app</span></a>
<div class="oa-text-body-md">
<a class="oa-link oa-link--standalone" href="#contact"><span class="oa-link__label">Ask about this</span><span class="oa-icon oa-icon--sm oa-icon--mirror oa-link__icon" aria-hidden="true" translate="no">arrow_forward</span></a>
</div>A clickable card (Card owns the card):
<article class="oa-card">
<h4 class="oa-card__title"><a class="oa-title-link oa-title-link--stretched" href="#job">Frontend Developer (React)</a></h4>
<p class="oa-card__meta">Byblos Digital Studio (Demo) · Beirut, Lebanon · Full-time · Hybrid</p>
<p><span class="oa-inline-status oa-inline-status--success"><span class="oa-icon oa-inline-status__icon" aria-hidden="true" translate="no">verified</span>Verified employer</span></p>
</article>Buttons drawn as links, a standalone "Report" beside a link and a task tile whose title opens a dialog:
<div class="oa-cluster">
<a class="oa-link oa-link--standalone" href="#safety"><span class="oa-link__label">Never pay to apply</span></a>
<button class="oa-link oa-link--standalone" type="button" aria-haspopup="dialog" aria-label="Report this job"><span class="oa-link__label">Report</span></button>
</div>
<article class="oa-card oa-card--tonal oa-card--sand">
<span class="oa-icon oa-icon--xl oa-icon--filled" aria-hidden="true" translate="no">support_agent</span>
<h4 class="oa-card__title"><button class="oa-title-link oa-title-link--stretched" type="button" aria-haspopup="dialog">Get help</button></h4>
<p class="oa-card__body">Questions about your ID or signing in</p>
</article>On an inverse band (Panel sets the color and the ring):
<div class="oa-panel oa-panel--inverse">
<p class="oa-text-body-lg">Applying is always free. Report any job that asks you for money. <a class="oa-link" href="#safety">Never pay to apply</a></p>
<a class="oa-link oa-link--standalone" href="#for-employers"><span class="oa-link__label">How it works</span><span class="oa-icon oa-icon--md oa-icon--mirror oa-link__icon" aria-hidden="true" translate="no">arrow_forward</span></a>
</div>Arabic:
<div class="ks-row" dir="rtl" lang="ar">
<p class="oa-text-body-lg">بالمتابعة فإنك توافق على <a class="oa-link" href="#privacy">إشعار الخصوصية</a>.</p>
<a class="oa-link oa-link--standalone" href="#jobs"><span class="oa-link__label">عرض كل الوظائف (15)</span><span class="oa-icon oa-icon--md oa-icon--mirror oa-link__icon" aria-hidden="true" translate="no">arrow_forward</span></a>
</div>The skip link, focused in place in reference/snippets/foundations.html (the demo attributes keep that copy out of the tab order; a page writes it as Behavior shows):
<a class="oa-skip-link" href="#main" tabindex="-1" data-demo-focus>Skip to content</a>Tailwind CSS v4
<!-- Inline -->
<a href="#privacy" class="rounded-8px font-semibold text-primary-ink underline decoration-auto underline-offset-4 wrap-anywhere hover:decoration-2">privacy notice</a>
<!-- Standalone: the underline on the label, 2px while the link is hovered; 8px padding the margin hides; the family Icon (20px) after it -->
<a href="#jobs" class="-mx-2 inline-flex min-h-12 items-center gap-2 rounded-full px-2 font-semibold text-primary-ink no-underline hover:[&>span]:decoration-2">
<span class="underline decoration-auto underline-offset-4">See all 15 jobs</span>
</a>
<!-- Stretched title link inside a relative card -->
<a href="#job" class="inline-block rounded-8px text-inherit hover:underline underline-offset-4 after:absolute after:inset-0 after:rounded-card focus-visible:outline-transparent focus-visible:after:outline-3 focus-visible:after:outline-focus-ring focus-visible:after:outline-offset-2">Frontend Developer (React)</a>
<!-- A button drawn as a standalone link: the same classes on <button type="button">, plus the reset of the button's box -->
<button type="button" aria-haspopup="dialog" aria-label="Report this job" class="-mx-2 inline-flex min-h-12 cursor-pointer items-center gap-2 rounded-full border-0 bg-transparent px-2 font-semibold text-primary-ink no-underline hover:[&>span]:decoration-2">
<span class="underline decoration-auto underline-offset-4">Report</span>
</button>
<!-- Skip link: fixed, parked above the window until focused -->
<a href="#main" class="fixed top-3 start-4 z-80 inline-flex min-h-12 items-center rounded-full bg-on-surface px-5 py-3 text-label-lg text-surface -translate-y-[calc(100%+1.5rem)] focus:translate-y-0">Skip to content</a>Inside an inverse band write text-inverse-primary on links (Tailwind has no context property). The arrow is the family Icon at text-(length:--size-icon-md) (text-(length:--size-icon-sm) beside 14px text); the Icon mirrors arrow_forward and north_east in RTL from its registry, so never add rtl:-scale-x-100 per use (canonical §8.3). shadcn/ui: Button link becomes a link with text-primary-ink, underlined at offset 4 (canonical §2.12).
React
| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
| TextLink | href | string | required | The destination. |
| TextLink | standalone | boolean | false | Its own line: 48px, the underline on the label. |
| TextLink | trailingIcon | 'arrow_forward' | 'north_east' |
none | Where it goes; mirrored in RTL. Not with icon. |
| TextLink | icon | 'call' | 'mail' |
none | A leading contact icon; the label is dir="ltr". |
| TextLink | external | boolean | false | target="_blank" rel="noopener", north_east, and the hidden "(opens in a new tab)" in the page language. |
| TitleLink | href | string | required | The card's one link. |
| TitleLink | stretched | boolean | false | Cover the card; the card must be position: relative. |
| SkipLink | target | string | 'main' |
The id of <main>, which has tabindex="-1". |
<p>{t.rich('setup.welcome.privacy', { link: (chunks) => <TextLink href="/privacy">{chunks}</TextLink> })}</p>
<TextLink href="/jobs" standalone trailingIcon="arrow_forward">{t('jobs.seeAll', { count })}</TextLink>
<TitleLink href={`/jobs/${job.slug}`} stretched>{job.title}</TitleLink>