# TableRow

> A table row (<tr>) for the Table family. Works in <thead> and <tbody>; selected renders the selection surface. Presentational; semantics belong to the surrounding table.

- Status: stable
- Group: data-display
- Page: https://www.digitaltableteur.com/design-system/components/table-row
- Contract: https://www.digitaltableteur.com/contracts/v1/TableRow.contract.json

## When to use

TableRow groups cells inside a Table's thead or tbody and carries the selected state visually while a real selection control (Checkbox) remains the source of truth.

## When not to use

- Do not render it outside a table.
- Do not rely on selected for semantics; pair it with a checkbox or aria-selected on the consuming structure.

## Look-alikes

The contract names no look-alike with a deciding condition.

## Props

| Prop | Type | Default | Description | Required |
| --- | --- | --- | --- | --- |
| `selected` | `boolean` | `false` | Renders the selected surface and sets `data-selected`. Visual only. | No |

## Variants

- Allowed `selected` values: `true`, `false` (default `false`).

## Invalid combinations

The contract records no invalid combinations.

## Keyboard

The contract records no keyboard interaction.

## Rules

Every item under When not to use is a MUST NOT. MUST and SHOULD follow RFC 2119.

| Level | Rule | How it is checked |
| --- | --- | --- |
| MUST | ARIA: <tr> with an explicit role=row, kept so rows stay rows when a stackOnNarrow Table changes display (some browsers drop native row semantics then); no other ARIA of its own. | Not yet verified: no evidence record. WCAG 4.1.2. |
| MUST | ARIA: Selection is visual only (data-selected); the row's selection state belongs to a checkbox or the consuming app. | Not yet verified: no evidence record. WCAG 4.1.2. |
| MUST | Required stories produce no axe violations at the configured severity. | Automated by `npm run test:stories:matrix:ci`. WCAG 2.5.8. |
| MUST | The accessibility tree (role, name, state) matches the committed snapshot for every required story. | Automated by `npm run test:stories:matrix:ci`. WCAG 1.3.1, 4.1.2. |
| MUST | The component remains legible and operable under a real browser forced-colors: active pass. | Automated by `npm run test:stories:hc`. |
| MUST | A human completed an end-to-end accessibility review of this component. | Manual review, last on 2026-11-04. |

## Install and import

- Install: `npm install @digitaltableteur/react` (version 0.9.1, restricted access on npm).
- Import: `import { TableRow } from "@digitaltableteur/react";`
- Entry point: `@digitaltableteur/react/content` exports it too.
- Styles: import `@digitaltableteur/react/style.css` once at the app boundary.

## Links

- Machine-readable contract (Design System Contract 1.0): https://www.digitaltableteur.com/contracts/v1/TableRow.contract.json
- Markdown version of this page: https://www.digitaltableteur.com/design-system/components/table-row.md
- Component index as JSON: https://www.digitaltableteur.com/design-system/components.json
- All components: https://www.digitaltableteur.com/design-system/components
- Source: The implementation lives in a private repository. This page, its Markdown twin and the contract are generated from it at build time and are the public source of truth.
