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
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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
All props accepted by this component, with their type, default value and description.
- itemrequiredIDataTableItemrequired
- 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
Content slots exposed by this component.
- #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
Events emitted by this component.
- @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
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- <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.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- 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
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | 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).
Foundation
Design tokens
Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.
- 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.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Custom cell slot
Ecosystem
Family
Components from the same folder that share conventions and often compose together.
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.