# Text

> Rost's type ramp as one component, from the 64px page title down to the 12px label.

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

## Install

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

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

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 |
|---|---|---|---|
| `variant` | enum | `display` `headline` `sub-headline` `lede` `body` `paragraph` `label` `eyebrow` | `body` |
| `tone` | enum | `primary` `secondary` `tertiary` `positive` `warning` `negative` |  |
| `weight` | enum | `regular` `medium` |  |
| `as` | string |  | `p` |
| `children` | slot |  |  |

## Anatomy

- `root`: Whatever `as` says. No margins: the layout around it does the spacing.

## When to use

- **Every line of words.** Titles, paragraphs, captions, the small print under a table. If it's words on a page and not inside another component, it's Text.
- **Titles by meaning.** `as="h1"` for the page's title, `h2` for its sections, whatever their size. A small section title is `variant=eyebrow as=h3`.

## When not to use

- **Words inside a component.** Inside a Button, a Badge or a TableItem. They bring their own type.
- **Making up a size.** A font size of your own. If none of these fits, the ramp is missing a step, and I'd rather add it here.

## Behaviour

One element, one size from the ramp, and no margins. `tone` and `weight` change only what they say. `display`, `headline` and `sub-headline` balance their lines, the longer ones wrap without leaving one word alone.

Not done yet: the ramp doesn't step down on a phone. 64px is a lot on a 375px screen, so the Rost site steps `display` and `sub-headline` down itself for now. That belongs here, once I know the steps for the apps too.

## Accessibility

- **Element**: whatever `as` says. Headings go in order: one `h1`, then `h2`, then `h3`.
- **Colour**: Every tone is 4.5:1 or better on the page and on the secondary plate, in both themes. The tightest are `tertiary` in light, 4.6:1 on the plate, and `negative` in dark, 6.2:1.

## Content

Sentence case everywhere, titles too. `eyebrow` is written in sentence case and drawn in capitals, so screen readers don't spell it out.

## Tokens

Every token this component uses, across all its variants.

| Token | Resolves to |
|---|---|
| `font-family/base` | `'General Sans Variable'` |
| `non-interactive/foreground/negative/base` | `#f2705f` |
| `non-interactive/foreground/positive/base` | `#00d669` |
| `non-interactive/foreground/primary` | `#ededed` |
| `non-interactive/foreground/secondary` | `#d3d9d5` |
| `non-interactive/foreground/tertiary` | `#999999` |
| `non-interactive/foreground/warning/base` | `#fda50d` |
| `typography/body/font-size` | `16px` |
| `typography/body/font-weight/regular` | `400` |
| `typography/body/letter-spacing` | `0px` |
| `typography/body/line-height` | `22px` |
| `typography/display/font-size` | `64px` |
| `typography/display/font-weight/medium` | `500` |
| `typography/display/letter-spacing` | `0px` |
| `typography/display/line-height` | `72px` |
| `typography/font-size/22` | `22px` |
| `typography/font-weight/medium` | `500` |
| `typography/font-weight/regular` | `400` |
| `typography/headline/font-size` | `56px` |
| `typography/headline/font-weight/medium` | `500` |
| `typography/headline/letter-spacing` | `0px` |
| `typography/headline/line-height` | `64px` |
| `typography/label/font-size` | `12px` |
| `typography/label/font-weight/regular` | `400` |
| `typography/label/letter-spacing` | `0px` |
| `typography/label/line-height` | `14px` |
| `typography/letter-spacing/letter-spacing` | `0px` |
| `typography/line-height/32` | `32px` |
| `typography/paragraph/font-size` | `14px` |
| `typography/paragraph/font-weight/regular` | `400` |
| `typography/paragraph/letter-spacing` | `0px` |
| `typography/paragraph/line-height` | `20px` |
| `typography/sub-headline/font-size` | `40px` |
| `typography/sub-headline/font-weight/medium` | `500` |
| `typography/sub-headline/letter-spacing` | `0px` |
| `typography/sub-headline/line-height` | `48px` |

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