DataTableHeaderCell
Individual <th> cell in a DataTable header row. Handles sort toggling, multi-sort badge, fixed column positioning and select-all checkbox.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-data-table-header-cell> — 4 parts: th root ①, content wrapper ②, sort icon ③, multi-sort badge ④.- 1.origam-data-table-header-cell
- Root
<th>element rendered viaOrigamDataTableColumnCell tag="th". Has--sortableand--sortedBEM modifiers and--fixedwhen the column is pinned. - 2.origam-data-table-header-cell__content
- Flex row containing the column title span, sort icon and optional multi-sort badge.
- 3.origam-data-table-header-cell__sort-icon
OrigamIconshown whencolumn.sortable && !disableSort. Opacity 0 at rest, 0.5 on hover, 1 when sorted. Has--activemodifier.- 4.origam-data-table-header-cell__sort-badge
- Pill badge showing the sort priority index when
multiSort=trueand the column is sorted.
API
Props
All props accepted by this component, with their type, default value and description.
- columnrequiredIInternalDataTableHeaderrequired
- The internal header descriptor for this column. Contains key, title, sortable, fixed, width, minWidth, maxWidth, align, colspan, rowspan and more.
- xrequirednumberrequired
- Column index (zero-based). Used internally by the header rendering logic.
- yrequirednumberrequired
- Row index (zero-based). Used to compute sticky top offset: calc(--origam-table-header-height * y).
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- disableSortbooleanfalse
- Disables sort toggling on all header cells. Overrides column.sortable.
- headerPropsany
- Additional attributes merged onto the underlying DataTableColumnCell element.
- stickybooleanfalse
- Makes the header sticky (position: sticky; top: calc(--origam-table-header-height * y)).
- multiSortbooleanfalse
- Enables multi-column sorting. When active, a numbered badge is shown next to the sort icon indicating sort priority.
- sortAscIcon
- Icon displayed when the column is sorted ascending.
- sortDescIcon
- Icon displayed when the column is sorted descending.
- color
- Foreground (text + icon) colour applied to the header cell via useBothColor.
- bgColor
- Background colour applied to the header cell surface.
API
Slots
Content slots exposed by this component.
- #header.{key}
- Per-column header slot. The slot name is dynamic: header.{column.key}. Overrides the default title + sort icon rendering.
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.
- Header cell text colour.
- Header cell background applied via the inner :deep(.origam-data-table-cell) rule.
- Sort icon opacity at rest (hidden).
- Sort icon opacity on column hover.
- Sort icon opacity when the column is actively sorted.
- Sort icon colour at rest.
- Sort priority badge background.
- Sort badge font size.
- Gap between title, sort icon and badge in the content row.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
Keyboard interactions
| Key | Action |
|---|---|
| Click / Enter | Toggles the sort direction on sortable columns. |
Notes
- Sortable columns expose <code>aria-sort="ascending"</code>, <code>aria-sort="descending"</code> or <code>aria-sort="none"</code> on the <code><th></code> element via the <code>:aria-sort</code> binding.
- When <code>column.key === "data-table-select"</code>, an <code>OrigamCheckboxBtn</code> with indeterminate state is rendered for accessible select-all interaction.
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 cell background — neutral.0 light / neutral.900 dark.
- colorvar(--origam-color__text---primary)
- Header cell text colour.
- numbervar(--origam-opacity---0)
- Sort icon opacity at rest (hidden).
- dimensionvar(--origam-radius---full)
- Sort badge border-radius (pill shape).
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.
Sortable header cell (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.
DataTableHeaders
Header row container that renders all header cells and an optional loader.
DataTableRow
Single data row rendering each column cell.
DataTableRows
Container that iterates items and renders rows, groups, skeletons and empty/loading states.