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
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #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
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 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.
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.
- Default header cell text colour (inherited from DataTableHeaderCell).
- Default header cell background (inherited from DataTableHeaderCell).
Inclusion
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
Interactions clavier
| Touche | 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.
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 row background colour.
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.
Sticky headers (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.
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.