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

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

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

All props accepted by this component, with their type, default value and description.

item
required
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

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

row

Keyboard interactions

Keyboard interactions
KeyAction
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).

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.

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.

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

vue

Ecosystem

Family

Components from the same folder that share conventions and often compose together.