DataTableHeaders
Header row container that renders all column header cells, an optional progress loader, and switches to mobile layout when the breakpoint is reached.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-data-table-headers> — 3 parts: root row container ①, individual header cells ②, and optional loader row ③.- 1.origam-data-table-headers
- Root element rendered by either
OrigamDataTableHeadersCell(desktop) orOrigamDataTableHeadersCellMobile(mobile). Has--stickyBEM modifier. - 2DataTableHeadersCell / DataTableHeadersCellMobile
- Desktop renders multi-row
<tr>elements withDataTableHeaderCellper column. Mobile renders a single merged row with sort/filter UI. - 3.origam-data-table-headers--progress
- Additional
<tr>row rendered conditionally whenloadingis active and loader kind is not "skeleton". Contains a full-width<th>withOrigamProgress.
API
Props
All props accepted by this component, with their type, default value and description.
- idstring
- classstring | Array<string> | object
- bgColor
- Background colour applied to header cells.
- stylestring | Array<string> | object | StyleValue
- color
- Foreground colour passed through to each DataTableHeaderCell and to the progress loader.
- mobileBreakpointnumber | TBreakpoint
- Viewport width threshold below which the mobile header layout is used.
- loadingTLoadingValuefalse
- When truthy, renders a progress bar in a dedicated row below the header. Accepts true (default line), "skeleton", "circular" or a percentage number.
- loadingTextstring
- tagstring
- disableSortbooleanfalse
- Disables sort toggling on all header cells.
- headerPropsany
- mobilebooleanfalse
- Forces mobile layout regardless of viewport width.
- stickybooleanfalse
- Makes the header sticky. Applies the --sticky BEM modifier and position: sticky to all header cells.
- multiSortbooleanfalse
- Enables multi-column sorting. Passed through to each DataTableHeaderCell.
- sortAscIcon
- Custom ascending sort icon forwarded to each header cell.
- sortDescIcon
- Custom descending sort icon forwarded to each header cell.
API
Slots
Content slots exposed by this component.
- #mobile
- Overrides the mobile header cell rendering (shown when mobile=true or viewport < mobileBreakpoint).
- #default
- Overrides the desktop (non-mobile) header cell rendering. Receives full sort and selection context.
- #loader
- Replaces the default OrigamProgress bar shown during loading. Rendered in a full-width th below the header.
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 child header cell components.
- 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 header cell text colour (inherited from DataTableHeaderCell).
- Default header cell background (inherited from DataTableHeaderCell).
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Moves focus through sortable header cells and the select-all checkbox. |
Notes
- Each sortable header cell exposes <code>aria-sort</code> ("ascending", "descending", or "none") on the <code><th></code> element.
- When loading, the progress row is inserted inside a <code><thead></code> scope, giving screen readers the context that loading is related to the table header.
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---raised)
- Header row background colour.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
This is an internal sub-part: it is injected by its parent component and cannot render on its own. See the parent component page for a live example.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Sticky headers (via DataTable)
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.
DataTableHeaderCell
Individual th cell in a DataTable header row with sort support.
DataTableRow
Single data row rendering each column cell.
DataTableRows
Container that iterates items and renders rows, groups, skeletons and empty/loading states.