# TableRow

> One row of a Table, with a hairline under it. It can be a link or something you pick, through its header cell.

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

## Install

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

```sh
npx github:Runceanu/rost add table-row
```

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 |
|---|---|---|---|
| `items` | slot |  |  |
| `href` | string |  |  |
| `selected` | boolean |  | `false` |

## States

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

## Anatomy

- `root`: A `<tr>`. Only a row with a link or a button in it reacts to the pointer and to focus: the states come from that `action`, not from the row.

## When to use

- **Every row.** Every row of a Table, the header row too.
- **A row that opens something.** A row that opens the thing it shows, with `href`: a payment, an invoice, a client.

## When not to use

- **Controls in a linked row.** Links or buttons in several cells of a row that's itself a link. The cover sits over them. Pick one: the row, or the controls.
- **A status as a fill.** Showing a status with the fill. `selected` means picked; a status is a **Badge** in a cell.

## Behaviour

A row with `href` or `onSelect` is one target: the pointer anywhere on it hovers and presses it, and focus draws a ring round the whole row. A plain row doesn't react. `selected` keeps its fill on hover, a shade lighter.

## Accessibility

- **Element**: a `<tr>`. The link or button lives in the row's header cell, because a `<tr>` can't be one. Its cover stretches over the row, so the whole row is the target.
- **Name**: the header cell's content: the link or button is named by what's in it, a date or a client's name. Make that cell say which row it is.
- **Keyboard**: a linked row is one Tab stop. Enter follows the link; Enter or Space presses the button.
- **Focus**: a 2px ring inside the row, on `:focus-visible` of its link or button.

## Content

One thing per row. The header cell names it.

## Tokens

Every token this component uses, across all its variants.

| Token | Resolves to |
|---|---|
| `spacing/outline/medium` | `2px` |
| `spacing/outline/small` | `1px` |
| `spacing/size/medium-large` | `48px` |
| `table-row/divider` | `#282828` |
| `table-row/focus/focus-ring` | `#999999` |
| `table-row/selected/default/background` | `#004c19` |
| `table-row/selected/hover/background` | `#006f27` |
| `table-row/unselected/hover/background` | `#171717` |
| `table-row/unselected/pressed/background` | `#3a3a3a` |

## No token, on purpose

| Part | Property | Value | Why |
|---|---|---|---|
| `root` | `outline-offset` | `-2px` | Inside the row, the ring's own width, so it isn't cut by the rows around it. |

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