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

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

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

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

column
requis
IInternalDataTableHeader
required
The internal header descriptor for this column. Contains key, title, sortable, fixed, width, minWidth, maxWidth, align, colspan, rowspan and more.
x
requis
number
required
Column index (zero-based). Used internally by the header rendering logic.
y
requis
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

Emplacements de contenu exposés par ce composant.

#header.{key}
Per-column header slot. The slot name is dynamic: header.{column.key}. Overrides the default title + sort icon rendering.

API

Membres exposés

Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.

<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.

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

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

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Interactions clavier

Interactions clavier
ToucheAction
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.

Fondation

Design tokens

Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.

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).

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Sous-partie interne : elle est injectée par son composant parent et ne peut pas se rendre seule. Voir la fiche du composant parent pour un exemple vivant.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Sortable header cell (via DataTable)

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.