<!--
  GENERATED FILE - do not edit by hand.
  Source of truth: src/components/mds-table-row/ in the magma monorepo (usage/*.md and the
  component's JSDoc). Regenerated on every stencil build (scripts/component-docs.ts).
-->

# mds-table-row

> `@maggioli-design-system/magma` 2.15.0. Shadow DOM: style it only through the public CSS custom properties and the parts below.

The `<mds-table-row>` web component represents a single data row inside a [`<mds-table>`](../mds-table/AGENTS.md) (slotted through `mds-table-body`; `mds-table-header` and `mds-table-footer` are rows themselves). It wraps a set of `mds-table-cell` children, and optionally exposes a per-row selection checkbox and an aside actions menu.

#### Semantic Behavior

- **Compound child only**: `<mds-table-row>` must be slotted inside the `mds-table-body` of an `<mds-table>`; it is not used standalone and its default slot must contain `mds-table-cell` elements, not arbitrary markup.
- **Parent-driven configuration**: `interactive`, `selectable`, and `overlayActions` are set by the parent `<mds-table>` on every row, so rows stay in sync with table state rather than being configured one by one.
- **Selection reporting**: When `selectable` is on, the row renders a leading selection checkbox; toggling it updates the row's `selected` prop and tells the table to recompute and emit the table-level selection event.
- **Selected as two-way state**: `selected` can be read and set by the parent to drive bulk select-all behavior.
- **Actions menu**: An `action`-named slot, when present, renders an actions cell that floats correctly over the scrolling row.
- **Localized accessibility labels**: The selection switch's title is localized (Select/Deselect row) across el/en/es/it.

#### Properties & Visual Configurations

Most props are orchestrated by the parent table rather than set directly by consumers:

- **`interactive`**: mirrors the table's interactive mode (hover highlight); normally inherited from `<mds-table>` rather than set per row.
- **`selectable`**: enables the leading selection switch; toggled by the table so all rows gain or lose selection together.
- **`overlayActions`**: set by the table when the row content overflows horizontally, switching the actions menu to an overlay rendering so it stays reachable while scrolling.
- **`selected`**: the row's current selection state; read and written by the parent for select-all and batch operations. Write it in the markup for a row that starts selected: the table counts it on load, without an `mdsTableSelectionChange`.
- **`value`**: the identifying payload reported back in the table's selection event for this row - set this to the business key (e.g. record id) you need when handling selections.

## Read next

- [`examples.md`](examples.md) - correct usage, from the most common case
- [`mistakes.md`](mistakes.md) - the wrong forms, each with the right one
- [Storybook](https://magma-design-system.github.io/magma/storybook/?path=/docs/layout-table-row--docs) - the live examples, in the published Storybook of `main`
- [`conventions.md`](../../../../agents/conventions.md), [`variants.md`](../../../../agents/variants.md), [`mistakes.md`](../../../../agents/mistakes.md) - the rules shared by every component

## Props

| Prop | Attribute | Type | Default | Description |
| --- | --- | --- | --- | --- |
| `interactive` | `interactive` | `boolean \| undefined` | - | Specifies whether the row reacts to user interaction (hover/focus). |
| `overlayActions` | `overlay-actions` | `boolean` | - | Specifies whether the row's actions are shown as an overlay. |
| `selectable` | `selectable` | `boolean \| undefined` | `undefined` | Specifies whether the row can be selected via a checkbox. |
| `selected` | `selected` | `boolean \| undefined` | - | Specifies whether the row is currently selected. |
| `selection` | `selection` | `boolean \| undefined` | - | Reflects the parent table selection state (set by mds-table); drives the row action background without :host-context |
| `value` | `value` | `number \| string \| undefined` | - | The value associated with the row, emitted when the row is selected. |

## Slots

| Slot | Description |
| --- | --- |
| (default) | Put `mds-table-cell` element/s. |
| `action` | Put `mds-button` element/s or other kind of actions as aside menu for the single row. |

## CSS custom properties

| Property | Description |
| --- | --- |
| `--mds-table-row-actions-background` | Read-only: the background the actions box paints in the current state of the row (at rest, on hover, while a column sorts a selectable table), for content of the `action` slot that paints it too when it moves out of the box. The box sets it itself, so a value set from outside changes nothing. |

Only these are public. Its other 5 are internal: they may change in any release, do not set them.

## Dependencies

Uses: `mds-table-cell`, `mds-input-switch`.
