Repository navigation
[EuiTable/EuiBasicTable/EuiInMemoryTable] Add sticky table headers - #9682
Conversation
…d fast column rendering
…utility and integrate it with `EuiTableStore`
…the original props destructuring
…move styles to a styles file
…nd resize handling
…e_header_cell_checkbox
|
This PR is marked as draft because I'm lacking unit tests. All functionality is (more or less) final |
|
Edit: Fixed in 1588c06 |
…header visibility control with simple `position: sticky` and some tricks
| `, | ||
| scrollableWrapper: css` | ||
| overflow-inline: auto; | ||
| overscroll-behavior-inline: none; |
There was a problem hiding this comment.
This is to prevent table overscroll on the horizontal axis, mainly on MacOS. It makes the table synchronization look significantly better, as it's not possible to read the overscroll state and simulate the same look and feel on the sticky header. It is a change to all tables, but considering that almost no tables are scrollable at this time, it's not going to be noticed by users.
acstll
left a comment
There was a problem hiding this comment.
🟢 I could have used a bit more time to read the code more carefully, but since this is experimental and opt-in, I think it's safe to merge — I tried breaking it and also followed the QA guide. It works pretty well and as expected. (I tried different browsers and also on Windows.)
I left a couple of nits regarding docs and code comments. We could ignore them but these are hard to get back to… 🙂
One extra thought to consider: if I'm not mistaken, the header duplication logic is needed because position: sticky does not yet support both vertical and horizontal axes… so the logic is only needed whenever the prop scrollableInline=true is passed… would it make sense to use the complex duplication logic exclusively when scrollableInline=true and otherwise fallback to the position: sticky technique? or would that make things even more complex?
Co-authored-by: Arturo Castillo Delgado <[email protected]>
Co-authored-by: Arturo Castillo Delgado <[email protected]>
Great question! I thought of it and the reason why I left it as-is is because When it comes to performance, the synchronization logic is pretty lightweight as well when That being said, I agree with your point and I'm really happy you're pointing this out! Let me create an issue for it as an optimization step and see if we could indeed benefit from this! |
💚 Build Succeeded
History
cc @tkajtoch |
💚 Build SucceededHistory
cc @tkajtoch |
## Dependency updates `@elastic/eui` - v116.2.0 ⏩ v116.3.1 `@elastic/eslint-plugin-eui` - v2.13.0 ⏩ v2.14.0 ## Package updates ### `@elastic/eui` [v116.3.1](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md) **Bug fixes** - Fixed `EuiTableHeaderCell` and `EuiTableHeaderCellCheckbox` throwing an error in Jest test environments due to static mocking of `useGeneratedHtmlId` by generating a stable, unique key with `uuidv4` ([#9698](elastic/eui#9698)) - Fixed an issue where the tooltip anchor wrapper in `EuiAvatar` did not have the same `border-radius` applied as the avatar itself. ([#9697](elastic/eui#9697)) ### `@elastic/eui` [v116.3.0](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md) - Added `EuiBanner` component ([#9673](elastic/eui#9673)) - Replaced native browser `title` attributes with `EuiToolTip` across the following components for consistent tooltips: ([#9643](elastic/eui#9643)) - `EuiAvatar` - `EuiBasicTable` - `EuiBreadcrumbs` - `EuiComboBox` - `EuiDataGrid` - `EuiAutoRefresh` - `EuiSuperDatePicker` - `EuiFieldPassword` - `EuiMarkdownEditor` - `EuiPagination` - `EuiSearchBar` - `EuiSelectable` - `EuiTextTruncate` - Extended `EuiToolTip`'s `display` prop to support `"flex"` ([#9643](elastic/eui#9643)) - Added experimental support for sticky headers in `EuiTable`, `EuiBasicTable` and `EuiInMemoryTable` ([#9682](elastic/eui#9682)) **Bug fixes** - Fixed `direction="row"` not applying on `EuiSplitPanel.Outer` when `onClick` was set. ([#9693](elastic/eui#9693)) - Fixed `EuiDatePicker` firing `onChange` with an out-of-bounds date when navigating to a month or year via the dropdowns while `minDate` or `maxDate` is set ([#9685](elastic/eui#9685)) - Fixed a visual issue on `EuiPanel` where panels with `onClick` would render with a `height` difference of `1px`. ([#9694](elastic/eui#9694)) - Fixed an issue in `EuiSelectable` and `EuiComboBox` where interactive content in group labels wasn't clickable due to overlapping content. ([#9678](elastic/eui#9678)) ### `@elastic/eslint-plugin-eui` [v2.14.0](https://github.com/elastic/eui/blob/main/packages/eslint-plugin/changelogs/CHANGELOG_2026.md) - Removed auto-fix from `tooltip-button-icon-wrap` rule ([#9695](elastic/eui#9695)) --------- Co-authored-by: Tomasz Kajtoch <[email protected]> Co-authored-by: Cursor <[email protected]> Co-authored-by: Lene Gadewoll <[email protected]>
## Dependency updates `@elastic/eui` - v116.2.0 ⏩ v116.3.1 `@elastic/eslint-plugin-eui` - v2.13.0 ⏩ v2.14.0 ## Package updates ### `@elastic/eui` [v116.3.1](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md) **Bug fixes** - Fixed `EuiTableHeaderCell` and `EuiTableHeaderCellCheckbox` throwing an error in Jest test environments due to static mocking of `useGeneratedHtmlId` by generating a stable, unique key with `uuidv4` ([elastic#9698](elastic/eui#9698)) - Fixed an issue where the tooltip anchor wrapper in `EuiAvatar` did not have the same `border-radius` applied as the avatar itself. ([elastic#9697](elastic/eui#9697)) ### `@elastic/eui` [v116.3.0](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md) - Added `EuiBanner` component ([elastic#9673](elastic/eui#9673)) - Replaced native browser `title` attributes with `EuiToolTip` across the following components for consistent tooltips: ([elastic#9643](elastic/eui#9643)) - `EuiAvatar` - `EuiBasicTable` - `EuiBreadcrumbs` - `EuiComboBox` - `EuiDataGrid` - `EuiAutoRefresh` - `EuiSuperDatePicker` - `EuiFieldPassword` - `EuiMarkdownEditor` - `EuiPagination` - `EuiSearchBar` - `EuiSelectable` - `EuiTextTruncate` - Extended `EuiToolTip`'s `display` prop to support `"flex"` ([elastic#9643](elastic/eui#9643)) - Added experimental support for sticky headers in `EuiTable`, `EuiBasicTable` and `EuiInMemoryTable` ([elastic#9682](elastic/eui#9682)) **Bug fixes** - Fixed `direction="row"` not applying on `EuiSplitPanel.Outer` when `onClick` was set. ([elastic#9693](elastic/eui#9693)) - Fixed `EuiDatePicker` firing `onChange` with an out-of-bounds date when navigating to a month or year via the dropdowns while `minDate` or `maxDate` is set ([elastic#9685](elastic/eui#9685)) - Fixed a visual issue on `EuiPanel` where panels with `onClick` would render with a `height` difference of `1px`. ([elastic#9694](elastic/eui#9694)) - Fixed an issue in `EuiSelectable` and `EuiComboBox` where interactive content in group labels wasn't clickable due to overlapping content. ([elastic#9678](elastic/eui#9678)) ### `@elastic/eslint-plugin-eui` [v2.14.0](https://github.com/elastic/eui/blob/main/packages/eslint-plugin/changelogs/CHANGELOG_2026.md) - Removed auto-fix from `tooltip-button-icon-wrap` rule ([elastic#9695](elastic/eui#9695)) --------- Co-authored-by: Tomasz Kajtoch <[email protected]> Co-authored-by: Cursor <[email protected]> Co-authored-by: Lene Gadewoll <[email protected]>
Summary
Resolves #9619
This PR adds support for table sticky headers. They can be activated by setting
stickyHeader = trueon<EuiTable>,<EuiBasicTable>or<EuiInMemoryTable>. It's marked as experimental, but the implementation is production-ready and doesn't have any (major) performance bottlenecks.Implementation details:
<table>due to browser compatibility issues. There was a recent decision made on per-axis scroll tracking that would make this implementation obsolete, but it's not currently available in any browsers on our support list. An experimental support was added in Chromium via experimental web platform features feature flag (issue), but it looks like it's going to be a while until this reaches GA.EuiTableStorethat feeds the sticky header implementation in<EuiTableStickyHeader>.<EuiTableHeaderCell>and<EuiTableHeaderCellCheckbox>register rendered columns in the store and update it whenever the column itself or its width change. This is achieved with a ref render function, which has access to all props and is scalable, reducing the synchronization and maintenance cost even though it looks a little strange at first sight<EuiTableStickyHeader>tracks the position of the original table and programmatically updates its scroll position to match the layout of the original table headerAPI Changes
EuiTable,EuiBasicTable,EuiInMemoryTablestickyHeaderScreenshots
Screen.Recording.2026-05-29.at.14.20.45.mov
Screen.Recording.2026-05-29.at.14.23.35.mov
Impact Assessment
Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.
🔴 Breaking changes — What will break? How many usages in Kibana/Cloud UI are impacted?💅 Visual changes — May impact style overrides; could require visual testing. Explain and estimate impact.🔧 Hard to integrate — If changes require substantial updates to Kibana, please stage the changes and link them here.Impact level: 🟢 Low to none
Release Readiness
Figma: {link to Figma or issue}Migration guide: {steps or link, for breaking/visual changes or deprecations}QA instructions for reviewer
Checklist before marking Ready for Review
Breaking changes: Addedbreaking changelabel (if applicable)Reviewer checklist