Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Open
tkajtoch wants to merge 11 commits intoelastic:mainfrom
tkajtoch:feat/9392-table-horizontal-scrolling
Open

[EuiTable] Add horizontal scrolling support via a new scrollable prop#9416
tkajtoch wants to merge 11 commits intoelastic:mainfrom
tkajtoch:feat/9392-table-horizontal-scrolling

Conversation

@tkajtoch
Copy link
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
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
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
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}?

@tkajtoch tkajtoch force-pushed the feat/9392-table-horizontal-scrolling branch from 018737d to 63bbd97 Compare March 3, 2026 00:04
@elasticmachine
Copy link
Collaborator

πŸ’š Build Succeeded

History

cc @tkajtoch

@elasticmachine
Copy link
Collaborator

πŸ’š Build Succeeded

History

cc @tkajtoch

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