# Typography

Six text styles: Archivo Variable at 550 for titles, Inter Variable at 450 or 600 for UI and body text, and Obel Mono at 450 or 600 strictly for code.

Live page: https://design.arcadia.is/foundations/typography

```tsx
import { Link } from "@arcadia/ui";
```

## Type roles

Compare size, weight and line height. Size and line height are in pixels.

### Weights

Use Archivo Variable at 550 for titles. Use Inter Variable at 450 for regular text and 600 for emphasis.

| Role | Token | Use |
| --- | --- | --- |
| Title 1 | `--font-size-title-1` | Public hero statements. |
| Title 2 | `--font-size-title-2` | Page titles. |
| Title 3 | `--font-size-title-3` | Section and dialog headings. Standalone empty-state glyphs use its box. |
| Headline | `--font-size-headline` | Reading text, subsection headings and large controls. |
| Body | `--font-size-body` | Default style for rows, menus, fields and labels. |
| Caption | `--font-size-caption` | Metadata, key hints, chips and compact controls. |
| Prose line height | `--line-height-prose` | 26px line for long-form Headline text. |
| Regular weight | `--weight-regular` | 450 for default interface text. |
| Bold weight | `--weight-bold` | 600 for interface emphasis. |
| Title weight | `--weight-title` | 550 for titles only. |

## Icon box

Match the full icon box to the text line.

The band shows the line. The frame includes the safe area.

## Controls

Caption for compact controls, Body for default, Headline for large.

## Both themes

## Code

Obel Mono is only for code. Numbers, times, counts, percentages and timers stay in Inter Variable with tabular figures.

- Numbers, times, counts and % (sans, tabular-nums)
- Code only (Obel Mono)

Universal rule: monospace (`--font-mono`, `stylex.env.text(role, weight, "mono")`, `code`, `pre`, `samp`, `kbd`) is permitted strictly for code.

- Use mono only for source code, syntax-highlighted blocks, inline code or tokens, CLI commands, terminal output, file paths, identifiers, and environment or secret key strings.
- Set all numbers, counts, percentages, ratios, timestamps, relative times, durations, timers, metrics, dimensions, pagination, badge counts, and chart or table readouts in sans (`--font-sans`, the default family of `stylex.env.text()`) with `fontVariantNumeric: "tabular-nums"` (`font-variant-numeric: tabular-nums`).
- Never set `stylex.env.text(role, weight, "mono")` or `var(--font-mono)` on non-code numeric, time, count, percentage, timer, or readout roles.

### Secrets

Mask recognized keys on reading surfaces. Keep editable keys visible.

- Masking off in fields
- Masking on by default

Masking is visual only. Copy and screen readers retain every character.

## Features

- Headline and below
- Titles

| Feature | Tag | Titles | Headline and below |
| --- | --- | --- | --- |
| Numbers: tabular figures | `tnum` | On | Opt in (tabular-nums) |
| Numbers: uppercase lining | `lnum` | On | Off |
| Ligatures | `liga` | On | Font default |
| Kerning pairs | `kern` | On | On |
| Case-sensitive forms | `case` | Off | Off |
| Slashed zero | `zero` | Off | On |
| Contextual alternates | `calt` | Off | On |
| Square punctuation | `ss07` | Off | On |
| Square quotes | `ss08` | Off | On |
| Lowercase l with tail | `cv05` | Off | On |
| Capital G with spur | `cv10` | Off | On |

| Token | Meaning and when to use |
| --- | --- |
| `--font-features-text` | Inter Variable keeps its slashed zero, square punctuation and distinct l and G glyphs. Case-sensitive forms are off. |
| `--font-features-display` | OpenType feature set for Archivo Variable titles: ligatures, kerning pairs, and tabular lining figures with no slashed zero. |
| `--font-features-mono` | OpenType feature set for Obel Mono on reading surfaces: renders recognized secret keys as masked dots. |
| `--font-features` | Active feature token inherited by an element. Set to normal on terminal output or raw key inputs where masking must be off. |

### Numbers

Set numbers, percentages, times, counts and timers in Inter Variable with tabular figures, never monospace.

- Proportional figures (sans)
- Tabular figures (sans, tabular-nums)

## Links

Keep links underlined and in the surrounding text ink.

Accent links keep the theme ink for agent names and mentions.

Use `onClick` without `href` for an in-place action.

Long addresses wrap inside their column.

Link ink across surfaces and states.

| Token | Meaning and when to use | Value |
| --- | --- | --- |
| `--text-link` | Accent link ink reserved for agent names, mentions and agent interactions. |  |
| `--link-underline` | Persistent resting underline at 30% of the link's own ink. Steps to full ink under increased contrast. |  |
| `--link-underline-hover` | Full-ink underline on hover, keyboard focus or press. |  |
| `--link-underline-accent` | Resting underline for accent-tone links at 30% of theme ink. |  |
| `--link-underline-accent-hover` | Full theme-ink underline on hover, keyboard focus or press for accent-tone links. |  |
| `--link-thickness` | Stroke thickness of every text underline. |  |
| `--link-offset` | Vertical offset keeping underlines clear of descenders. |  |

## Text wrapping

Balance titles, wrap prose evenly and let streaming text wrap plainly.

- Title, balanced lines
- Paragraph, even rag
- Streaming text, plain wrap

## Text that doesn't fit

Shorten or rearrange content before applying an overflow treatment.

| Step | What it does | Pattern |
| --- | --- | --- |
| 1. Shorten it | Show fewer characters, such as a path's final folder or a branch without its namespace. | Shorter label forms |
| 2. Give way | Collapse lower-priority chips to icon-only first, revealing their labels on hover. | Priority row |
| 3. Wrap it | Break long names or addresses inside their column. | Plain wrap |
| 4. Let motion say it | Use a moving spinner beside a short status word instead of trailing dots. | Spinner |

## Families

The kit bundles Archivo Variable, Inter Variable and Obel Mono.

| Token | Example | Meaning and when to use |
| --- | --- | --- |
| `--font-display` | The quick brown fox | Archivo Variable at 550 for Title 1, Title 2 and Title 3. |
| `--font-sans` | The quick brown fox | Inter Variable at 450 or 600 for Headline, Body, Caption and all numbers (with tabular-nums). |
| `--font-mono` | make watch | Obel Mono at 450 or 600, strictly for code. Never for numbers, times, counts, percentages or timers. |

### On touch

Inputs step up to Headline on touch to prevent zoom.

A shortcut's chip stays at Caption size: 

## API reference

### Link

- `tone` (`"neutral" | "accent"`, default `"neutral"`): `neutral`: the ink of the text around it. `accent`: the theme ink, where the context calls for it.
- `href` (`string`): Where it leads: the link is an `<a>` to it, with the anchor's props. Left out, the link acts in place by its required `onClick`, a `<button type="button">` with the button's props, which never submits a form.
- `rootStyle` (`RootStyle`): Typed StyleX override: layout.
- `onClick` (`MouseEventHandler<HTMLButtonElement>`)
- `className` (`string`): The hook class of the kit part this link stands in ("ui-actor-name-link"), never styles.

Rest props go to `<a>` props and `<button>` props.
