Server Component · 0 KB client JS

Link

An inline text link with accent-channel coloring and external-link handling.

Read the getting-started guide before launch.

Always underlined: theming reference.

External: react.dev (opens in new tab) (new tab, safe rel).

Any hue: purple link, green link.

Import#

import { Link } from "astralis-ui";

For client-side routing, pass your router's component: <Link as={NextLink} href="/docs">.

Line clamp#

lineClamp cuts a long link off after that many lines with an ellipsis, which keeps card titles and list rows even. The full text stays in the DOM, so screen readers and search still get all of it.

Props#

PropTypeDefaultDescription
variant"underline" | "hover" | "plain""hover"Underline behavior.
colorSchemeall 15 schemes"brand"Hue (via the accent channel).
externalbooleanfalseNew tab + `rel="noopener noreferrer"` + ↗ marker.
lineClamp"1" | "2" | "3" | "4" | "5" | "6"NoneTruncates a long link to this many lines with an ellipsis. Responsive.
asElementType"a"Router link component.

A link is text with special highlighting, so it also takes every Text typography prop (size, weight, color, casing, align, lineHeight, letterSpacing), each responsive.

Unlike Text it defaults none of them. A bare <Link> emits no type classes at all, so it inherits from the paragraph around it, which is what an inline link should do:

<Text size="sm">
  Small copy with an <Link href="#">inline link</Link> that stays small.
</Text>

<Link href="#" size="lg" weight="semibold">A large standalone link</Link>

Setting color explicitly holds it in both states: the hover colour shift is dropped rather than swapping your colour out from under you, and variant's underline carries the affordance instead. That is what makes a link usable on a surface the accent channel does not cover:

<Box bg="inverted" p="6">
  <Link href="#" color="inverted" variant="hover">Readable on the inverted fill</Link>
</Box>