DataTableHeaderCell
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.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- columnrequisIInternalDataTableHeaderrequired
- The internal header descriptor for this column. Contains key, title, sortable, fixed, width, minWidth, maxWidth, align, colspan, rowspan and more.
- xrequisnumberrequired
- Column index (zero-based). Used internally by the header rendering logic.
- yrequisnumberrequired
- 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
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
| Touche | 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.
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.
- 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).
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)
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.
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.