-
Notifications
You must be signed in to change notification settings - Fork 862
[EuiTable] Add optional transparent table via hasBackground prop
#9224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EuiTable] Add optional transparent table via hasBackground prop
#9224
Conversation
- will be used to resolve deprecated legacy token
- adjusts styles and classes to ensure separation between background styles and non-background styles based on prop - uses a context to share the prop as prop drilling wouldn't easily be possible and manually setting hasBAckground on sub component seems tedious
- it's not a 1:1 color replacement but a replacement that makes sense within the new token system
- triggered due to equal specificity. On colorMode change newly added Emotion styles would override in loading order and cause shifts
- triggered due to new class for hasBackground
- changes are due to the reduced 1px bottom border as well as adding additional hasBackground images
a0f295b to
a74366a
Compare
JoseLuisGJ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
acstll
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A 👻 and a question. Code looks correct and everything is working nicely as expected, couldn't find any regressions compared to production (went through all QA steps).
packages/eui/src/components/basic_table/basic_table.stories.tsx
Outdated
Show resolved
Hide resolved
packages/eui/src/components/basic_table/basic_table.stories.tsx
Outdated
Show resolved
Hide resolved
acstll
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 Thanks for addressing my comments!
- we actually didn't need the extra isEmpty check
95914c1 to
d9807ae
Compare
💚 Build SucceededHistory
cc @mgadewoll |
💚 Build Succeeded
History
cc @mgadewoll |
Summary
closes #9186
closes #8231
This PR updates
EuiTableand the more specificEuiBasicTableandEuiInMemoryTablecomponents by adding support for the prophasBackground.This prop controls the appliance of a background color on the table component and respective sub components. When
hasBackground=true, the table has no background color besides state backgrounds (hover, selected, marked).Mobile tables (which look like panels) with
hasBackground=falsewill have no background, no shadow and borders instead.API changes
hasBackgroundbooleantrueAdditional changes
euiTheme.components.tableFooterBackgroundto handle the custom background color definitions (we might want to check these eventually, if they should be aligned with existing tokens). euiTableRowCell__mobileHeaderwhich results in a slight color change in dark mode (#7186A8->#98A8C3Why are we making this change?
💅 UI updates: This update is part of the design work 🔒 to update the look and feel of the UI. This update on
EuiTablespecifically will support creating more clean page/table layouts.Screenshots #
hasBackground
hasBackground=true(default)hasBackground=falseUpdated
.euiTableRowCell__mobileHeadercolorMobile table action buttons alignment bug
Screen.Recording.2025-11-19.at.09.39.05.mov
Screen.Recording.2025-11-19.at.09.39.31.mov
Impact to users
🟢 There are no code updates required by consumers.
ℹ️ Due to the added
hasBackgroundprop and related Emotion class, snapshot tests may fail and require updates.QA
🧪 Storybook:
Checks:
hasBackgroundapplies correctly:hasBackground=trueand productionGeneral checklist
@defaultif default values are missing) and playground toggles