DataTableHeaderCell

Data Display
stable

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.

Anatomy of OrigamDataTableHeaderCellSchematic of DataTableHeaderCell with 4 internal parts. Column Title ↑ 1 1 2 3 4 origam-data-table-header-cell
Anatomy of <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 via OrigamDataTableColumnCell tag="th". Has --sortable and --sorted BEM modifiers and --fixed when 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
OrigamIcon shown when column.sortable && !disableSort. Opacity 0 at rest, 0.5 on hover, 1 when sorted. Has --active modifier.
4.origam-data-table-header-cell__sort-badge
Pill badge showing the sort priority index when multiSort=true and the column is sorted.

API

Props

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

column
required
IInternalDataTableHeader
required
The internal header descriptor for this column. Contains key, title, sortable, fixed, width, minWidth, maxWidth, align, colspan, rowspan and more.
x
required
number
required
Column index (zero-based). Used internally by the header rendering logic.
y
required
number
required
Row index (zero-based). Used to compute sticky top offset: calc(--origam-table-header-height * y).
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
disableSort
boolean
false
Disables sort toggling on all header cells. Overrides column.sortable.
headerProps
any
Additional attributes merged onto the underlying DataTableColumnCell element.
sticky
boolean
false
Makes the header sticky (position: sticky; top: calc(--origam-table-header-height * y)).
multiSort
boolean
false
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

Keyboard interactions
KeyAction
Click / EnterToggles 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>&lt;th&gt;</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.

Source
color
var(--origam-color__surface---raised)
Header cell background — neutral.0 light / neutral.900 dark.
color
var(--origam-color__text---primary)
Header cell text colour.
number
var(--origam-opacity---0)
Sort icon opacity at rest (hidden).
dimension
var(--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)

vue

Ecosystem

Family

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