On this page

InstallationIn a paragraphStylesWith the app's linkIn an AlertBeside the Button's linkIn the dashboardAccessibilityAPI ReferenceRulesWritten down

Text link

A link inside a sentence. It is text: it takes the sentence's size and breaks across lines with it.

Agents reach a tool through a gateway.

1<p>2  Agents reach a tool through <TextLink href="/gateways">a gateway</TextLink>.3</p>

Installation

import { TextLink } from "@catalog-dashboard/components";

In a paragraph

The link takes the size, weight and line height of the sentence it is in, and breaks across lines where the sentence does.

Agents and people cannot reach the three tools, two models and one pool that no gateway reaches until you attach them.

1<p className="w-80 text-body-2 text-neutral-fg-secondary">2  Agents and people cannot reach <TextLink href="#resources">the three tools, two models and one pool that no gateway reaches</TextLink> until you attach them.3</p>

Styles

A style is one choice, color. Primary, the link purple, is the link in plain text, with no underline. Every other value is underlined, in its color's paragraph text and its title text under the pointer: on gray or colored text, color alone cannot mark a link. primary-underline is the purple one underlined, for a purple paragraph.

primary

Agents reach a tool through a gateway.

primary-underline

Agents reach a tool through a gateway.

neutral

Agents reach a tool through a gateway.

success

Agents reach a tool through a gateway.

warning

Agents reach a tool through a gateway.

error

Agents reach a tool through a gateway.

info

Agents reach a tool through a gateway.

fuchsia

Agents reach a tool through a gateway.

1<TextLink href="/gateways" color="primary">a gateway</TextLink>2<TextLink href="/gateways" color="primary-underline">a gateway</TextLink>3<TextLink href="/gateways" color="neutral">a gateway</TextLink>4<TextLink href="/gateways" color="success">a gateway</TextLink>5<TextLink href="/gateways" color="warning">a gateway</TextLink>6<TextLink href="/gateways" color="error">a gateway</TextLink>7<TextLink href="/gateways" color="info">a gateway</TextLink>8<TextLink href="/gateways" color="fuchsia">a gateway</TextLink>

With the app's link

render makes it another element, so a link to a page of the product is the app's own: in the dashboard, ScopedLink; here, Next's Link.

A standalone action is the Button's link.

1<p className="w-80 text-body-2 text-neutral-fg-secondary">2  A standalone action is <TextLink render={<Link href="/components/button" />}>the Button's link</TextLink>.3</p>

In an Alert

An Alert's paragraph is colored already, so color cannot mark a link there: the links inside it are underlined, and keep the paragraph's color. Under the pointer they take the title's. The Alert sets that once, for every link it holds: a link in it needs no style of its own. One given a style keeps it.

Not attached to a gateway
Agents and people cannot reach 3 tools until you attach them.
1<Alert color="warning" title="Not attached to a gateway">2  Agents and people cannot reach <TextLink href="#resources">3 tools</TextLink> until you attach them.3</Alert>

Beside the Button's link

The same words, in the same 320px sentence. The Button's link is one block that cannot break, so it runs past the edge; its size sets its own type; it carries an icon and a press; its words cannot be selected. It is for an action that stands alone.

Agents and people cannot reach until you attach them.

Agents and people cannot reach the three tools, two models and one pool that no gateway reaches until you attach them.

1{/* The Button's link, inside a sentence: do not. */}2<p className="w-80 text-body-2 text-neutral-fg-secondary">3  Agents and people cannot reach <Button color="primary" emphasis="link" size="sm">the three tools, two models and one pool that no gateway reaches</Button> until you attach them.4</p>5 6<p className="w-80 text-body-2 text-neutral-fg-secondary">7  Agents and people cannot reach <TextLink href="#resources">the three tools, two models and one pool that no gateway reaches</TextLink> until you attach them.8</p>

In the dashboard

Links inside sentences in the dashboard use it: the forms' gray sentences and descriptions (neutral), the billing and contact links (primary), and the links the dashboard renders from Markdown. Some links in sentences are still styled by hand (the text-link class), and move to this component later. A Field's description underlines the links inside it by itself.

Accessibility

A TextLink is the HTML <a> element: the Tab key reaches it, Enter follows it, and a screen reader reads it as a link, by its words. Its focus ring follows it onto each line it breaks across.

Primary is told from its sentence by its color. Every other style takes its sentence's color, so its underline tells it, as in an Alert.

API Reference

Besides these, the props of an <a> (target, rel…).

PropTypeDefaultDescription
color"neutral" | "primary" | "primary-underline" | "success" | "warning" | "error" | "info" | "fuchsia"—Its style. Primary is the link purple, with no underline; every other value is underlined, in its color's paragraph text; primary-underline is the purple one underlined. Unset, what holds it decides: primary in plain text, the Alert's own in an Alert.
hrefstring—Where a plain link goes. A link to a page of the product takes render instead.
targetstring—"_blank" opens it in a new tab; give it rel="noreferrer" too.
renderReactElement—Another element in its place: the app's own link.
childrenReactNode—The link's words.

Rules

Written down

Inside a sentence, a TextLink; alone, the Button's link

A link inside a sentence is a TextLink. A link that stands alone as an action, beside or under text, is the Button's link (emphasis="link").

From ds/README.md (Text link) and ds/components/text-link.tsx.

Primary is marked by color; every other style by its underline

Primary is the link color, and the Button's primary link's color under the pointer, with no underline. Every other color takes its paragraph's text color, so it is always underlined.

From ds/README.md (Text link) and ds/components/text-link.tsx.

In an Alert, underlined in the paragraph's color

Under the pointer it takes the title's color. The Alert sets it for every link inside it, so a link there needs no style; one given a style keeps it.

From ds/README.md (Text link) and ds/tokens/text-link.css.

Catalog
Foundations
  • Overview
  • Tokens
  • Token usage
  • Typography
  • Icons
Atoms
  • Avatar
  • Badge
  • Button
  • Checkbox
  • Color picker
  • Copy button
  • Icon tooltip
  • Inline code
  • Input
  • Hint
  • Kbd
  • Loader
  • Native select
  • Progress bar
  • Progress ring
  • Radio
  • Select
  • Status dot
  • Switch
  • Text link
  • Textarea
  • Tooltip
  • Truncate
Molecules
  • Accordion
  • Activity chart
  • AI elements
  • Alert
  • Button group
  • Card
  • Code block
  • Combobox trigger
  • Command
  • Context switcher
  • Dropdown menu
  • Empty state
  • Field
  • Field group
  • Filter chip
  • Flow
  • Icon picker
  • Metric card
  • Modal
  • Modal confirmation
  • Pagination
  • Popover
  • Scroll area
  • Sidebar
  • Table
  • Tabs
  • Toggle group
LibraryPublished release