# Link

> A link inside text. Green and underlined, or quiet in the text's own colour.

| | |
|---|---|
| Kind | component |
| Contract | `review` · [link.contract.yaml](https://github.com/Runceanu/rost/blob/master/contracts/link.contract.yaml) |
| Guidance | `proposed` |
| Source | [Figma 705:81](https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=705-81) · read 2026-11-04 · frozen 2026-11-04 |
| Implemented in | nowhere yet |

## Install

It lands in `src/rost/link/`, with what it needs and its contract:

```sh
npx github:Runceanu/rost add link
```

Then import `src/rost/fonts.css` and `src/rost/tokens.css` once, at the root of the app. More on this in [Install](https://rost.build/docs/install.md).

## Props

| Prop | Type | Values | Default |
|---|---|---|---|
| `href` | string |  |  |
| `tone` | enum | `accent` `quiet` | `accent` |
| `external` | boolean |  | `false` |
| `children` | slot |  |  |

## States

`Default` · `Hover` · `Pressed` · `Focus`

## Anatomy

- `root`: An `<a>`. It sits in a line of text, so it takes the text's size and weight.
- `label`: The visually hidden "(opens in a new tab)" of an external link.

## When to use

- **In a sentence.** Pointing somewhere from inside a sentence, a note or a table cell.
- **A row of sources.** `quiet` for a footer or a line of links under a section, where every word is a link.

## When not to use

- **Doing something.** Starting an action, like saving or sending. That's **Button**.
- **Standing alone.** A link on its own line that's the main way on. A **Button** with `href` reads as the next step, a Link doesn't.

## Behaviour

The underline is always there on `accent`, so a link never relies on colour alone. `quiet` takes the text's colour and shows the underline on hover. An external link opens a new tab and gets a hidden "(opens in a new tab)". I didn't add an arrow icon: in running text it was more noise than help.

## Accessibility

- **Element**: an `<a href>`. Without an href it isn't a link, so don't render one.
- **Name**: the words inside. "here" or "more" tell a screen reader nothing out of context.
- **Colour**: `accent` is `non-interactive/foreground/positive/base`: 6:1 on the light page and 5.3:1 on the light card, 9:1 or more in dark.

## Content

Say where it goes, in a few words. Sentence case.

## Tokens

Every token this component uses, across all its variants.

| Token | Resolves to |
|---|---|
| `actions/primary/focus/focus-ring` | `#b6ffda` |
| `motion/duration/fast` | `150ms` |
| `motion/easing/standard` | `ease` |
| `non-interactive/foreground/positive/base` | `#00d669` |
| `non-interactive/foreground/positive/dark` | `#b6ffda` |
| `non-interactive/foreground/primary` | `#ededed` |
| `spacing/outline/medium` | `2px` |
| `spacing/outline/small` | `1px` |
| `spacing/radius/xsmall` | `4px` |

## No token, on purpose

| Part | Property | Value | Why |
|---|---|---|---|
| `root` | `text-underline-offset` | `0.2em` | Follows the text's size, so it's in em, not a space token. |

See it live, with every value of every variant: [rost.build/components/link/](https://rost.build/components/link/)
