DataTableRow

Data Display
stable

Single data row (<tr>) in a DataTable. Renders each column cell, handles row selection, expand toggle, and switches to mobile stacked layout below the breakpoint.

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamDataTableRowSchematic of DataTableRow with 4 internal parts. ☑ column value column value ⌄ 1 2 3 4 origam-data-table-row
Anatomy of <origam-data-table-row> — 4 parts: tr root ①, select column (CheckboxBtn) ②, data column cell ③, expand column (Btn) ④.
1.origam-data-table-row
Root <tr> element. Has --clickable BEM modifier when onClick/onContextmenu/onDblclick listeners are attached. Has --mobile modifier when in mobile layout.
2.origam-data-table-row__column--select-row
Column cell modifier for the data-table-select column. Renders an OrigamCheckboxBtn. In mobile layout uses grid-template-columns: 0; justify-content: end.
3.origam-data-table-row__column
Generic column cell class applied to each OrigamDataTableColumnCell. In mobile mode wraps title and value in a 2-column grid.
4.origam-data-table-row__column--expanded-row
Column cell modifier for the data-table-expand column. Renders an expand/collapse OrigamBtn with aria-expanded. In mobile layout uses grid-template-columns: 0; justify-content: center.

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

item
requis
IDataTableItem
required
The internal item descriptor. Contains raw data, processed column values, type, key, and index.
cellProps
TDataTableCell<any>
Static or callback props forwarded to every DataTableColumnCell inside the row. A function receives { index, item, internalItem, value, column }.
mobile
boolean
false
Forces mobile stacked layout. When true, each cell shows a column title label and a value in a two-column grid.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
mobileBreakpoint
number | TBreakpoint
Viewport width threshold below which mobile layout is automatically activated.

API

Slots

Emplacements de contenu exposés par ce composant.

#item.data-table-select
Overrides the default CheckboxBtn in the selection column.
#item.data-table-expand
Overrides the default expand/collapse button in the expand column.
#item.{key}
Per-column data slot. The slot name is dynamic: item.{column.key}. Overrides the default value display for the matching column.
#header.{key}
In mobile layout, each cell shows a column title that can be overridden via this header slot.

API

Emits

Événements émis par ce composant.

@expand
{ item: IDataTableItem, value: boolean }
Fired when the expand toggle button is clicked inside the data-table-expand column.
@select
{ item: IDataTableItem, value: boolean }
Fired when the selection checkbox is toggled in the data-table-select column.

API

Membres exposés

Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props to a child component.
Ref<string>
Reactive CSS string generated by useStyle.
string
Unique style-sheet ID for this instance.
() => void
Injects the computed style sheet into the document.
() => void
Removes the injected style sheet.
Ref<boolean>
True once the style sheet has been injected into the DOM.

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

Default row background colour.
Default row text colour.
Row background colour on hover.
Duration of the background-colour transition on hover/select.
Easing function for the row background transition.
Font weight of the column title label in mobile stacked layout.
Minimum height of each stacked cell in mobile layout.

Inclusion

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Rôles ARIA

row

Interactions clavier

Interactions clavier
ToucheAction
SpaceToggles row selection via the CheckboxBtn (when the selection column is present).
EnterToggles row expansion via the expand Btn (when the expand column is present).

Notes

  • <code>aria-selected</code> is set on the <code>&lt;tr&gt;</code> when the selection column is present. It is omitted (undefined) for non-selectable rows.
  • <code>aria-rowindex</code> is set by the parent DataTableRows component on each row (startIndex + index + 2, 1-based, accounting for the header row).
  • The expand button exposes <code>aria-expanded</code> (true/false) and a localised <code>aria-label</code> via the DS i18n provider (keys: origam.dataTableRow.collapseRow / expandRow).

Fondation

Design tokens

Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.

Source
color
var(--origam-color__surface---default)
Default row background.
color
var(--origam-color__surface---overlay)
Row background on hover.
duration
var(--origam-motion__duration---fast)
Row background transition duration.
fontWeight
var(--origam-font__weight---medium)
Column label weight in mobile stacked layout.
dimension
52px
Minimum cell height in mobile stacked layout.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Custom cell slot

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.