DataTableRow
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.
<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--clickableBEM modifier when onClick/onContextmenu/onDblclick listeners are attached. Has--mobilemodifier 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 usesgrid-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
OrigamBtnwith aria-expanded. In mobile layout usesgrid-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.
- itemrequisIDataTableItemrequired
- The internal item descriptor. Contains raw data, processed column values, type, key, and index.
- cellPropsTDataTableCell<any>
- Static or callback props forwarded to every DataTableColumnCell inside the row. A function receives { index, item, internalItem, value, column }.
- mobilebooleanfalse
- Forces mobile stacked layout. When true, each cell shows a column title label and a value in a two-column grid.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- mobileBreakpointnumber | 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
Interactions clavier
| Touche | Action |
|---|---|
| Space | Toggles row selection via the CheckboxBtn (when the selection column is present). |
| Enter | Toggles row expansion via the expand Btn (when the expand column is present). |
Notes
- <code>aria-selected</code> is set on the <code><tr></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.
- colorvar(--origam-color__surface---default)
- Default row background.
- colorvar(--origam-color__surface---overlay)
- Row background on hover.
- durationvar(--origam-motion__duration---fast)
- Row background transition duration.
- fontWeightvar(--origam-font__weight---medium)
- Column label weight in mobile stacked layout.
- dimension52px
- 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
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.
DataTable
Full-featured data table with sorting, pagination, selection and grouping.
DataTableRows
Container that iterates items and renders rows, groups, skeletons and empty/loading states.
DataTableHeaders
Header row container that renders all column header cells and an optional loader.
DataTableHeaderCell
Individual th cell in a DataTable header row with sort support.