# Textarea

> A text field for several lines, with Input's label, help line, error and focus ring.

| | |
|---|---|
| Kind | component |
| Contract | `review` · [textarea.contract.yaml](https://github.com/Runceanu/rost/blob/master/contracts/textarea.contract.yaml) |
| Guidance | `agreed` |
| Source | [Figma 528:814](https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=528-814) · read 2026-10-30 · frozen 2026-10-30 |
| Implemented in | nowhere yet |

## Install

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

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

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 |
|---|---|---|---|
| `label` | slot |  |  |
| `value` | slot |  |  |
| `placeholder` | slot |  |  |
| `supportive` | slot |  |  |
| `selected` | boolean |  | `false` |
| `error` | boolean |  | `false` |

## States

`Default` · `Hover` · `Disabled`

## Anatomy

- `root`: Input's field, grown down. The same 12px padding and corners, and the same tokens for every colour.
- `outline`: The field's fill and its 1px edge, on their own layer, as in Input.
- `header`: The label's line, with the alarm at the end when there's an error. 16px tall either way, so the text doesn't move when an error shows up.
- `label`: Input's floated label: placeholder type, regular. Unlike Input it never sits large in the field. A box this tall would leave it floating alone in the middle.
- `icons-alarm`: Input's alarm, at 16px so it fits the label's line. Input draws it at 24 beside a single line.
- `value`: The real `<textarea>`. Its own look goes; it takes the field's type and colour. You can drag it taller, not wider.
- `supportive`: Hangs below the field, outside it, as Input's does. Leave 16px under a field that has one.
- `focus-ring`

## When to use

- **More than a line.** Text that runs to more than a line: a note on a payment, a message, a description.

## When not to use

- **One line.** One line of text, like a name or an amount. That's **Input**.
- **Rich text.** Rich text with bold and lists. This is plain text only.

## Behaviour

It's Input grown down, with the same tokens for the fill, the edge, the label, the help line and the focus ring. Three things change it:

- **`selected`**: it has focus, so the focus ring shows.
- **`error`**: the edge, label and help text go red, and the alarm shows at the end of the label's line.
- **`state`**: `Default`, `Hover` and `Disabled`.

One difference from Input: the label always sits small at the top. Input's label sits large in an empty field, but in a box three lines tall it would float alone in the middle. It starts three lines tall (`rows`), and you can drag it taller.

I built it in code from Input's contract, then drew it in the kit, on a page of its own, with Input's variables. The seven variants match Figma.

## Accessibility

- **Element**: a real `<textarea>` with a `<label for>`. Never a `placeholder` instead of the label.
- **Supportive Text**: connected with `aria-describedby`.
- **Error**: `aria-invalid="true"`, and the help text says how to fix it.
- **Colour**: an error shows as the alarm icon and the message, not only red.
- **Keyboard**: Tab reaches it and Enter starts a new line, so a form with one can't submit on Enter from inside it.
- **Focus**: the ring shows on `:focus-visible` and when you arrive by keyboard. Never remove the outline without the ring.

## Content

Label: a noun, sentence case ("Note"). Help text: one line, a hint before an error and the fix after it ("Keep it under 500 characters"). The help line hangs below the field, so leave 16px under it.

## Tokens

Every token this component uses, across all its variants.

| Token | Resolves to |
|---|---|
| `font-family/base` | `'General Sans Variable'` |
| `opacity/solid` | `1` |
| `spacing/gap/2xsmall` | `4px` |
| `spacing/gap/none` | `0px` |
| `spacing/gap/small` | `8px` |
| `spacing/gap/small-medium` | `12px` |
| `spacing/outline/medium` | `2px` |
| `spacing/outline/small` | `1px` |
| `spacing/radius/large` | `16px` |
| `spacing/radius/medium` | `12px` |
| `spacing/size/2xsmall` | `16px` |
| `textarea/negative/default/background` | `#060805` |
| `textarea/negative/default/icon` | `#e93120` |
| `textarea/negative/default/label` | `#e93120` |
| `textarea/negative/default/outline` | `#f2705f` |
| `textarea/negative/default/placeholder` | `#999999` |
| `textarea/negative/default/supportive` | `#e93120` |
| `textarea/negative/focus/background` | `#060805` |
| `textarea/negative/focus/focus-ring` | `#00d669` |
| `textarea/negative/focus/icon` | `#e93120` |
| `textarea/negative/focus/label` | `#e93120` |
| `textarea/negative/focus/outline` | `#f2705f` |
| `textarea/negative/focus/supportive` | `#e93120` |
| `textarea/negative/focus/value` | `#ededed` |
| `textarea/negative/hover/background` | `#171717` |
| `textarea/negative/hover/icon` | `#e93120` |
| `textarea/negative/hover/label` | `#f2705f` |
| `textarea/negative/hover/outline` | `#e93120` |
| `textarea/negative/hover/placeholder` | `#999999` |
| `textarea/negative/hover/supportive` | `#e93120` |
| `textarea/regular/default/background` | `#060805` |
| `textarea/regular/default/label` | `#999999` |
| `textarea/regular/default/outline` | `#747573` |
| `textarea/regular/default/placeholder` | `#c2c7c3` |
| `textarea/regular/default/supportive` | `#999999` |
| `textarea/regular/disabled/background` | `#171717` |
| `textarea/regular/disabled/label` | `#555555` |
| `textarea/regular/disabled/outline` | `#3a3a3a` |
| `textarea/regular/disabled/placeholder` | `#555555` |
| `textarea/regular/disabled/supportive` | `#555555` |
| `textarea/regular/focus/background` | `#060805` |
| `textarea/regular/focus/focus-ring` | `#00d669` |
| `textarea/regular/focus/label` | `#999999` |
| `textarea/regular/focus/outline` | `#747573` |
| `textarea/regular/focus/placeholder` | `#c2c7c3` |
| `textarea/regular/focus/supportive` | `#999999` |
| `textarea/regular/hover/background` | `#171717` |
| `textarea/regular/hover/label` | `#d3d9d5` |
| `textarea/regular/hover/outline` | `#999999` |
| `textarea/regular/hover/placeholder` | `#d3d9d5` |
| `textarea/regular/hover/supportive` | `#d3d9d5` |
| `typography/label/font-weight/medium` | `500` |
| `typography/label/font-weight/regular` | `400` |
| `typography/paragraph/font-size` | `14px` |
| `typography/paragraph/font-weight/regular` | `400` |
| `typography/paragraph/letter-spacing` | `0px` |
| `typography/paragraph/line-height` | `20px` |
| `typography/placeholder/font-size` | `10px` |
| `typography/placeholder/letter-spacing` | `0px` |
| `typography/placeholder/line-height` | `12px` |

## No token, on purpose

| Part | Property | Value | Why |
|---|---|---|---|
| `icons-alarm` | `mask` | `url(./icon-alarm.svg) center / contain no-repeat` | The icon file itself, the same one Input uses. |
| `supportive` | `top` | `calc(100% + var(--spacing-gap-2xsmall))` | Composed from a token: the field's own height, whatever it is, plus spacing/gap/2xsmall. |
| `focus-ring` | `inset` | `calc(-1 * var(--spacing-gap-2xsmall))` | Composed from a token: the ring sits spacing/gap/2xsmall outside the field. |

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