Skip to content

[EuiButton][EuiButtonEmpty] Update button paddings#8948

Merged
mgadewoll merged 9 commits intoelastic:feat/visual-refresh-append-prepend-updatesfrom
mgadewoll:button/749-update-paddings
Sep 1, 2025
Merged

[EuiButton][EuiButtonEmpty] Update button paddings#8948
mgadewoll merged 9 commits intoelastic:feat/visual-refresh-append-prepend-updatesfrom
mgadewoll:button/749-update-paddings

Conversation

@mgadewoll
Copy link
Copy Markdown
Contributor

@mgadewoll mgadewoll commented Aug 6, 2025

Summary

Important

This PR merges into a feature branch.

closes https://github.com/elastic/platform-ux-team/issues/749

This PR updates paddings of button components according to design specifications.

Changes

  • updated outer paddings of buttons (anything that uses EuiButtonDisplay internally)
    • size m -> 12px padding
    • size s -> 8px padding
    • size xs -> 6px padding
  • updated inner padding between button content to 4px and 2px (xs buttons)
  • added additional 4px padding on button text content (string content only)
  • updated usages of buttons (those are generally EuiButtonEmpty and EuiButtonIcon) inside form append/prepend to align with the expected padding and sizing
  • updated EuiFilterButton padding between content to 4px to align with base buttons

Important

The changes to button padding affect their usage visually in form append/prepend elements.
There is an additional issue to implement the new, stricter API for single-content/action API for append/prepend usages which will replace custom input in the future and ensure a more cohesive look.
With this following update we generally want to start a migration of append/prepend usages and we'll stop advertising custom content usages.

Deployment

The changes have been deployed here:

Why are we making this change?

Implementing a design change to balance spacing in buttons with different content (icons, text etc) and align paddings across different usages (e.g. buttons and form append/prepend).

Screenshots #

  • EuiButton
before after
Screenshot 2025-08-06 at 18 25 36 Screenshot 2025-08-06 at 18 24 20
Screen.Recording.2025-08-06.at.18.39.51.mov
  • EuiFilterButton
Screen.Recording.2025-08-06.at.17.06.41.mov
  • usages in append/prepend on EuiFormControlLayout
before after
Screenshot 2025-08-06 at 18 20 23 Screenshot 2025-08-07 at 14 17 42
Screen.Recording.2025-08-07.at.14.17.29.mov

Impact to users

⚠️ There are no changes needed on consumer side but the updates have a visual effect due to spacing changes.
Consumer implementations should be reviewed to find potential visual issues.

QA

Stories:

Steps:

  • review the button padding changes and verify that the expected padding is applied
  • smoke-test button-related components and/or check the VRT updates and verify there are no unexpected regressions
  • verify that there are no regressions for Amsterdam

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)
  • 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)

- adds additional 4px padding on text content and adjusts button padding per size
@mgadewoll mgadewoll requested a review from ek-so August 6, 2025 16:41
@mgadewoll mgadewoll self-assigned this Aug 6, 2025
@mgadewoll mgadewoll force-pushed the button/749-update-paddings branch from ff31b48 to 17f17b5 Compare August 7, 2025 07:18
@mgadewoll mgadewoll marked this pull request as ready for review August 7, 2025 08:06
@mgadewoll mgadewoll requested a review from a team as a code owner August 7, 2025 08:06
@ek-so
Copy link
Copy Markdown
Contributor

ek-so commented Aug 7, 2025

Hey @mgadewoll, thank you! The changes look good, one ask please — could we adjust the text box for empty XS buttons to be 2px rather than 4px?

ek-so
ek-so approved these changes Aug 7, 2025
@mgadewoll
Copy link
Copy Markdown
Contributor Author

Hey @mgadewoll, thank you! The changes look good, one ask please — could we adjust the text box for empty XS buttons to be 2px rather than 4px?

@ek-so Sure 👍 The label has now 2px padding for xs buttons.

Screen.Recording.2025-08-07.at.14.13.30.mov

@mgadewoll mgadewoll force-pushed the button/749-update-paddings branch from feb43b3 to 0efc86f Compare August 7, 2025 13:03
@acstll acstll self-requested a review August 25, 2025 08:57
Copy link
Copy Markdown
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.

I strictly followed the suggested steps for QA (thanks for providing those!) and it's all looking good.

I only left 2 remarks, only one may require action, which is a possible Amsterdam regression

  • Amsterdam: padding for text content is there but it wasn't before (I think I spotted the place in the code)
  • [no action] the layout in EuiSearchBar / EuiSearchBarFilters gets weird in small viewports but I don't think it matters
Screenshots

4px inline padding for text content in Amsterdam

production

Screenshot 2025-08-28 at 18 40 07

PR

Screenshot 2025-08-28 at 18 39 30

weird layout for EuiSearchBar…

Screenshot 2025-08-28 at 14 35 45

})
),
uncompressed: `
&:not(:has(> ${buttons}:first-child, > *:first-child > ${buttons})) {
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] this caught my attention, probably because of the complexity, but I think it was there already higher up in the file, so I wouldn't touch and I also don't think it's actually bad

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's been around already. Since the form layout API allows to pass anything (e.g. buttons) currently, this is how some styles are selectively targeted.

@mgadewoll
Copy link
Copy Markdown
Contributor Author

Yeah, this is expected as is currently. The filters wrap in a flex layout and the width changes due to the content padding.

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

@acstll acstll self-requested a review September 1, 2025 10:22
Copy link
Copy Markdown
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 the clarifications and the update, looks good to merge!

@mgadewoll mgadewoll merged commit 5c0a7fc into elastic:feat/visual-refresh-append-prepend-updates Sep 1, 2025
4 checks passed
mgadewoll added a commit to mgadewoll/eui that referenced this pull request Dec 12, 2025
mgadewoll added a commit to mgadewoll/eui that referenced this pull request Jan 5, 2026
mgadewoll added a commit to elastic/kibana that referenced this pull request Feb 23, 2026
## Dependency updates

- `@elastic/eui` - v112.3.0 ⏩ v113.0.0
- `@elastic/eui-theme-borealis` - v5.4.0 ⏩ v6.0.0
- `@elastic/eslint-plugin-eui` - v2.8.0 ⏩ v2.9.0

---

## Changes

1. EUI component update: API and Design updates to form layout
append/prepend by using the new components `EuiFormPrepend` and
`EuiFormAppend` (EUI [#9308](elastic/eui#9308))

>[!important]
❗ This upgrade PR includes all changes previously made in the specific
QA PR #248805.
Please see the description in that PR for detailed information about the
specific changes.

2. Additional changes related to the form layout changes

>[!note]
🔗 Please see the [section "Additional
changes"](#248805 (comment))
in #248805 for an overview of
additional changes.

3. Removed token update: Replaced `ghost` and `ink` token usages with
`textInk` or `plainDark` and `textGhost` or `plainLight` respectively
(EUI [#9379](elastic/eui#9379))

## Package updates

### `@elastic/eui`
[v113.0.0](https://github.com/elastic/eui/releases/tag/v113.0.0)

- Updated `EuiFlyout` manager to close all flyouts when a parent flyout
is closed. ([#9378](elastic/eui#9378))
- Added `textInk` and `textGhost` color tokens for text and icon colors
that should always remain dark or light regardless of color mode.
([#9379](elastic/eui#9379))
- Added `EuiFormAppend` and `EuiFormPrepend` components
([#9014](elastic/eui#9014))
- Added support for `type="span"` on `EuiFormLabel` for visual-only form
labels ([#9014](elastic/eui#9014))
- Updated `EuiFormLabel` to render a `span` if no `htmlFor` is passed
([#9014](elastic/eui#9014))
- Updated `EuiFormControlLayout` to use `EuiFormAppend` and
`EuiFormPrepend` ([#9014](elastic/eui#9014))
- Updated `EuiAutoRefresh` and `EuiColorPicker` to use `EuiFormPrepend`
([#9014](elastic/eui#9014))
- Updated `EuiFormAppend`/`EuiFormPrepend` styling
([#9305](elastic/eui#9305))
- Updated `EuiFormAppend`/`EuiFormPrepend` to inherit `isDisabled` state
from `EuiFormControlLayout`
([#9305](elastic/eui#9305))
- Updated `EuiFormControlLayout` hover, disabled and readonly styling
([#9305](elastic/eui#9305))
- Updated `EuiFormControlButton` to inherit `isDisabled`, `readOnly` and
`isInvalid` states from `EuiFormControlLayout`
([#9305](elastic/eui#9305))
- Added `iconSide` prop on `EuiDatePickerRange`
([#9305](elastic/eui#9305))
- Updated `EuiSuperDatePicker` valid state styling
([#9305](elastic/eui#9305))
- Removed background color transition on `EuiButtonEmpty` (other button
variants don't have a transition anymore either)
([#9305](elastic/eui#9305))
- Added `isLoading` prop on `EuiFormControlButton`
([#9328](elastic/eui#9328))
- Updated paddings for `EuiButton`, `EuiButtonEmpty`, `EuiFilterButton`
([#8948](elastic/eui#8948))
- Updated paddings for `append`/`prepend` on `EuiFormControlLayout`
([#8948](elastic/eui#8948))
- Added optional `scrollContainerRef` prop to `EuiFlyoutBody` for
accessing the flyout's internal scroll container.
([#9373](elastic/eui#9373))

**Bug fixes**

- Updated `EuiColorPicker` to ensure `id` is correctly passed onto the
internal `EuiFormControlLayout`
([#9014](elastic/eui#9014))

**Breaking changes**

- Removed `ink` and `ghost` theme tokens. Use `textInk` / `textGhost`
for text and icon colors or `plainDark` /`plainLight` for non-text use
cases. ([#9379](elastic/eui#9379))
- Updated `EuiQuickSelectPopover` in `EuiSuperDatePicker` to use
`EuiFormPrepend`. This results in more restricted `buttonProps` as they
reflect `EuiFormPrepend` instead of generic `EuiButtonEmpty` props.
([#9014](elastic/eui#9014))
- Removed `components.superDatePickerBackgroundSuccees` token
([#9305](elastic/eui#9305))

### `@elastic/eui-theme-borealis` v6.0.0

- Added `textInk` and `textGhost` color tokens for text and icon colors
that should always remain dark or light regardless of color mode.
([#9379](elastic/eui#9379))

### `@elastic/eslint-plugin-eui` v2.9.0

- Prevented `badge-accessibility-rules` rule autofix from duplicating
`aria-hidden` attributes.
([#9366](elastic/eui#9366))
- Skip `badge-accessibility-rules` rule validation when a spread
operator is used in a component.
([#9366](elastic/eui#9366))

---------

Co-authored-by: Weronika Olejniczak <weronika.olejniczak@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants