# Quiet link

A link that takes the surrounding text color and keeps its underline, for dense UI.

_Diagram: Quiet links sit in dense parts of the content: the order numbers in a table's first column and names in a muted metadata line._

## Live example

### In a table

```html
<section data-scroll="inline" aria-labelledby="orders-caption" tabindex="0">
  <table>
    <caption id="orders-caption">Recent orders</caption>
    <thead>
      <tr><th scope="col">Order</th><th scope="col">Customer</th><th scope="col">Total</th></tr>
    </thead>
    <tbody>
      <tr><td><a href="#table-title" data-link="quiet">#1042</a></td><td>Ada Lovelace</td><td>€120.00</td></tr>
      <tr><td><a href="#table-title" data-link="quiet">#1041</a></td><td>Alan Turing</td><td>€48.50</td></tr>
    </tbody>
  </table>
</section>
```

### In muted metadata

```html
<p data-text="small muted">Posted by <a href="#meta-title" data-link="quiet">Grace Hopper</a> in <a href="#meta-title" data-link="quiet">Compilers</a>.</p>
```

### Visited links

```html
<p>A content link: <a href="">read about quiet links</a>.</p>
<nav aria-label="Atoms">
  <ul class="cluster">
    <li><a href="">Quiet link</a></li>
  </ul>
</nav>
<ul>
  <li><a href="" data-link="nav">Quiet link</a>, navigational outside a nav</li>
</ul>
```

## Attributes

`data-link="quiet"` on `<a href>`; `data-link="nav"` keeps a navigational link outside a `<nav>` out of the visited color (combinable)

| Attribute or value | Where | Effect |
| --- | --- | --- |
| `data-link="quiet"` | `<a href>` | surrounding text color |
| `data-link="nav"` | `<a href>` | navigational outside a `<nav>`, so it keeps its unvisited color once visited |

Space-separated: `data-link="quiet nav"` works.

- For dense UI, such as table cells, footers and metadata, where many accent-colored links would be noisy.
- Visited links keep the surrounding color too.

## Accessibility

- The underline stays, so color is never the only cue ([WCAG 1.4.1](https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html)).
- The link takes the surrounding text color, which already has 4.5:1 contrast.

## Specifications

- [WHATWG `a`](https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element)
- [WCAG 1.4.1](https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html)

## See also

- [Atoms](https://domestic-ui.odonckers.dev/atoms/index.md)
- [Component API convention](https://domestic-ui.odonckers.dev/index.md#component-api)
- [Accessibility baseline](https://domestic-ui.odonckers.dev/principles/accessibility-baseline-wcag-22-aa.md)
- Source: [`css/components/atoms/link.css`](https://github.com/odonckers/domestic-ui/blob/main/css/components/atoms/link.css), [`examples/atoms/link.html`](https://github.com/odonckers/domestic-ui/blob/main/examples/atoms/link.html)

## How other systems do it

For comparison only; these are not the standard this system follows.

- Apple Human Interface Guidelines: No equivalent
- Material Design 3: No equivalent
- Vercel Geist: No equivalent
