Skip to content

[EuiTable] Add horizontal scrolling support via a new scrollableInline prop#9416

Merged
tkajtoch merged 14 commits intoelastic:mainfrom
tkajtoch:feat/9392-table-horizontal-scrolling
Mar 5, 2026
Merged

[EuiTable] Add horizontal scrolling support via a new scrollableInline prop#9416
tkajtoch merged 14 commits intoelastic:mainfrom
tkajtoch:feat/9392-table-horizontal-scrolling

Conversation

@tkajtoch
Copy link
Copy Markdown
Member

@tkajtoch tkajtoch commented Feb 28, 2026

Summary

Resolves #9392

This PR adds horizontal scrolling support to the EuiTable component as well as EuiBasicTable and EuiInMemoryTable that use it internally.

Why are we making this change?

Part of the tables sweep initiative.

Screenshots #

scrollable = true (and responsiveBreakpoint = "xs" for the purpose of a small screen demo)

Screenshot 2026-02-28 at 01 04 03

Impact to users

Horizontal scrolling is disabled by default right now. Users need to opt in by setting scrollable={true} on the component or in component defaults.

QA

Remove or strikethrough items that do not apply to your PR.

General checklist

  • Browser QA
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
  • Docs site QA
    • Props have proper autodocs (using @default if default values are missing) and playground toggles
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately

@tkajtoch tkajtoch marked this pull request as ready for review February 28, 2026 00:13
@tkajtoch tkajtoch requested a review from a team as a code owner February 28, 2026 00:13
@tkajtoch tkajtoch self-assigned this Feb 28, 2026
@weronikaolejniczak weronikaolejniczak self-requested a review March 2, 2026 10:03
Copy link
Copy Markdown
Contributor

@weronikaolejniczak weronikaolejniczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is such a small PR but it's so impactful! I tested it on exemplary tables in Kibana and it's working as expected 👍🏻 I have some blocking doubts.

Testing notes

The tables would probably need a thorough audit to make sure all cases work with horizontal scrolling but I tested the 3 component types for the time being. And yes, I used an AI agent for this, super helpful 👍🏻

✅ Storybook EuiTable playground story

Kapture.2026-03-02.at.12.45.56.mp4

❌ Storybook EuiBasicTable playground story

Image

Control missing.

Solution

Add to args:

args: {
  // ... existing args
  scrollable: false,
}

then:

moveStorybookControlsToCategory(
  meta,
  ['responsiveBreakpoint', 'tableLayout', 'hasBackground', 'scrollable'],  // ADD 'scrollable'
  'EuiTable props'
);

❌ Storybook EuiInMemoryTable playground story

Image

Control missing.

Solution

Add to args:

args: {
  // ... existing args
  scrollable: false,
}

then:

moveStorybookControlsToCategory(
  meta,
  ['responsiveBreakpoint', 'tableLayout', 'hasBackground', 'scrollable'],  // ADD 'scrollable'
  'EuiTable props'
);

EuiTable Kibana usage

File: x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/index_table/index_table.js
Test path: Stack Management → Index Management

Kapture.2026-03-02.at.12.42.51.mp4

EuiBasicTable Kibana usage

File: x-pack/platform/plugins/shared/triggers_actions_ui/public/application/sections/rules_list/components/rules_list_table.tsx
Test path: Stack Management → Rules

Kapture.2026-03-02.at.13.21.23.mp4

Solution

Destructure scrollable in basic_table.tsx at lines 524 and 551 and pass to EuiTable at line 568.

Kapture.2026-03-02.at.13.33.40.mp4

EuiInMemoryTable Kibana usage

File: x-pack/platform/plugins/shared/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx
Test path: Stack Management → Index Management → Data Streams tab
Note: Toggle "Include stats" ON for more columns

Kapture.2026-03-02.at.13.23.58.mp4

Solution

Destructure scrollable in basic_table.tsx at lines 524 and 551 and pass to EuiTable at line 568. This works for EuiInMemoryTable because it uses EuiBasicTable internally, so there's no separate fix.

Kapture.2026-03-02.at.13.26.29.mp4

Other general doubts

  1. scrollable is ambiguous to me. It could relate to "vertically scrollable" as well and be misinterpreted as something to do with pagination. Did you consider the more verbose but meaningful horizontallyScrollable?
  2. Don't we want to document this prop (even if beta) in Responsive tables? We have the convention of using EuiBadge (or actually EuiBetaBadge but we're deprecating it) beside the header to denote beta functionalities. What I fear is that consumers will pass scrollable and expect it to ✨ just work ✨ while we need responsiveBreakpoint={false} and tableLayout="auto". I'd imagine something like "Responsive tables > Card view", "Responsive tables > Horizontal scrolling".
  3. There are no tests covering horizontal scrolling for the 3 components. Should we add them here? Could be for EuiTable and EuiBasicTable only, if we want to be thorough it can also be for EuiInMemoryTable. I would verify there's a scroll.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no action required:

Very good call on adding this to component defaults. This way, we "defer" the decision to Kibana whether they want to opt-in for all tables or not 👍🏻

Comment on lines +47 to +56
/**
* Allow the table to grow over 100% of the container width
* and enable horizontal scrolling on overflow.
*
* This should only be used with [`tableLayout`]{@link EuiTableProps#tableLayout}
* set to `auto`.
* @beta
* @default false
*/
scrollable?: boolean;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semi-blocking: Should we also mention responsiveBreakpoint={false}?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are technically separate props. There could be uses where you set both to achieve a specific look.

I'm going to write a whole new documentation page on recommended table configurations, where this will be mentioned. Overall, responsiveBreakpoint and the mobile card view should only be used in very specific cases.

@tkajtoch tkajtoch force-pushed the feat/9392-table-horizontal-scrolling branch from 018737d to 63bbd97 Compare March 3, 2026 00:04
@tkajtoch tkajtoch changed the title [EuiTable] Add horizontal scrolling support via a new scrollable prop [EuiTable] Add horizontal scrolling support via a new scrollableInline prop Mar 3, 2026
tkajtoch and others added 2 commits March 3, 2026 11:10
Co-authored-by: Weronika Olejniczak <32842468+weronikaolejniczak@users.noreply.github.com>
@tkajtoch
Copy link
Copy Markdown
Member Author

tkajtoch commented Mar 3, 2026

@weronikaolejniczak Thank you for a detailed review! I pressed "ready for review" too quickly, without thinking much. Friday evenings...

scrollable is ambiguous to me. It could relate to "vertically scrollable" as well and be misinterpreted as something to do with pagination. Did you consider the more verbose but meaningful horizontallyScrollable?

I renamed it to scrollableInline to follow the modern inline/block naming. I'd like to update it in other places, too, but that's a topic for another day.

Don't we want to document this prop (even if beta) in Responsive tables? We have the convention of using EuiBadge (or actually EuiBetaBadge but we're deprecating it) beside the header to denote beta functionalities. What I fear is that consumers will pass scrollable and expect it to ✨ just work ✨ while we need responsiveBreakpoint={false} and tableLayout="auto". I'd imagine something like "Responsive tables > Card view", "Responsive tables > Horizontal scrolling".

I added a section to the docs that describes the new prop and its intended usage. I had to use EuiBetaBadge because the regular EuiBadge shows up in our sidebar as text, which we don't want. We should probably have a docs-only beta component that we can replace all EuiBetaBadge usages with.

There are no tests covering horizontal scrolling for the 3 components. Should we add them here? Could be for EuiTable and EuiBasicTable only, if we want to be thorough it can also be for EuiInMemoryTable. I would verify there's a scroll.

I added tests to cover the updated logic!

Copy link
Copy Markdown
Contributor

@weronikaolejniczak weronikaolejniczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🟢 It's working as expected. Thanks for addressing my feedback!

Co-authored-by: Weronika Olejniczak <32842468+weronikaolejniczak@users.noreply.github.com>
@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @tkajtoch

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @tkajtoch

@tkajtoch tkajtoch merged commit 8703e43 into elastic:main Mar 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiTable] Add horizontal scrolling on overflow when tableLayout is set to auto

3 participants