Skip to content

Conversation

@mgadewoll
Copy link
Contributor

@mgadewoll mgadewoll commented Nov 19, 2025

Summary

closes #9186
closes #8231

This PR updates EuiTable and the more specific EuiBasicTable and EuiInMemoryTable components by adding support for the prop hasBackground.
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=false will have no background, no shadow and borders instead.

API changes

prop type default value description
hasBackground boolean true Toggles the table's background on/off

Additional changes

  • replaces a few deprecated theme tokens
    • adds euiTheme.components.tableFooterBackground to handle the custom background color definitions (we might want to check these eventually, if they should be aligned with existing tokens)
    • updates the text color token for . euiTableRowCell__mobileHeader which results in a slight color change in dark mode (#7186A8 -> #98A8C3
  • fixes an alignment bug for table actions when switching color modes. The reason for the bug was an updated Emotion style order due to equal specificity. By ensuring a higher specificity we ensure a stable style appliance.

Why 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 EuiTable specifically will support creating more clean page/table layouts.

Screenshots #

hasBackground

hasBackground=true (default) hasBackground=false
Screenshot 2025-11-19 at 09 32 18 Screenshot 2025-11-19 at 09 32 25
Screenshot 2025-11-19 at 09 32 14 Screenshot 2025-11-19 at 09 32 29
Screenshot 2025-11-18 at 11 46 43 Screenshot 2025-11-18 at 11 21 50
Screenshot 2025-11-18 at 11 46 39 Screenshot 2025-11-18 at 11 21 46
Screenshot 2025-11-19 at 09 35 03 Screenshot 2025-11-19 at 09 35 00
Screenshot 2025-11-19 at 09 35 09 Screenshot 2025-11-19 at 09 35 12

Updated .euiTableRowCell__mobileHeader color

before after
Screenshot 2025-11-18 at 17 31 50 Screenshot 2025-11-18 at 17 31 53
Screenshot 2025-11-18 at 17 31 24 Screenshot 2025-11-18 at 17 31 28

Mobile table action buttons alignment bug

before after
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 hasBackground prop and related Emotion class, snapshot tests may fail and require updates.

QA

🧪 Storybook:

Checks:

  • verify hasBackground applies correctly:
    • tables have no background
    • table footer has no background
    • expanded rows have no background
    • state backgrounds for hover, marked, selected etc still work as expected
  • verify that there is no unexpected regression for hasBackground=true and production
  • verify that the action buttons in mobile tables don't change position when toggling between color modes

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in both MacOS and Windows high contrast modes
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
    • Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately
    • If applicable, added the breaking change issue label (and filled out the breaking change checklist)
    • If the changes unblock an issue in a different repo, smoke tested carefully (see Testing EUI features in Kibana ahead of time)
  • Designer checklist
    • If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)

@mgadewoll mgadewoll self-assigned this Nov 19, 2025
- 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
@mgadewoll mgadewoll force-pushed the table/9186-transparent-background branch from a0f295b to a74366a Compare November 19, 2025 08:58
@mgadewoll mgadewoll requested a review from JoseLuisGJ November 19, 2025 08:58
@mgadewoll mgadewoll marked this pull request as ready for review November 19, 2025 09:44
@mgadewoll mgadewoll requested a review from a team as a code owner November 19, 2025 09:44
Copy link
Contributor

@JoseLuisGJ JoseLuisGJ left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@acstll acstll self-requested a review November 20, 2025 11:21
Copy link
Contributor

@acstll acstll left a 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).

Copy link
Contributor

@acstll acstll left a 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
@mgadewoll mgadewoll force-pushed the table/9186-transparent-background branch from 95914c1 to d9807ae Compare November 20, 2025 16:59
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

@mgadewoll mgadewoll merged commit 4dbf6c2 into elastic:main Nov 21, 2025
9 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.

[EuiBasicTable] Add optional background transparency (default to false) [EuiBasicTable] Difference in action positioning between color modes

4 participants