[EuiFormControlButton] Fix alignment for icons when no label is passed#9588
Merged
mgadewoll merged 6 commits intoelastic:mainfrom Apr 13, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a visual regression in EuiFormControlButton where icon-only buttons with iconSide="right" were not aligning the icon to the right when no label text (value/placeholder) is present, and expands the Storybook kitchensink cases + VRT references to prevent regressions.
Changes:
- Adds a
hasText/iconSide-based conditional style to right-align icon-only content. - Introduces a new Emotion style (
alignEnd) for content alignment. - Refactors/expands the kitchensink story and updates Loki reference screenshots; adds an upcoming changelog entry.
Reviewed changes
Copilot reviewed 4 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/eui/src/components/form/form_control_button/form_control_button.tsx | Adds conditional content alignment when there is no text and the icon is on the right. |
| packages/eui/src/components/form/form_control_button/form_control_button.styles.ts | Adds alignEnd style (justify-content: flex-end). |
| packages/eui/src/components/form/form_control_button/form_control_button.stories.tsx | Refactors kitchensink rendering and adds icon-only scenarios for VRT coverage. |
| packages/eui/changelogs/upcoming/9588.md | Documents the bug fix in upcoming changelog. |
| packages/eui/.loki/reference/*.png | Updates VRT reference images for the expanded kitchensink cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
💚 Build SucceededHistory
cc @mgadewoll |
Collaborator
💚 Build Succeeded
History
cc @mgadewoll |
weronikaolejniczak
approved these changes
Apr 13, 2026
Contributor
weronikaolejniczak
left a comment
There was a problem hiding this comment.
LGTM 🟢 Thanks for fixing it, Lene!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a visual issue in
EuiFormControlButtonwhere a right aligned icon would not be placed on the right side if no button label is passed viavalue.To track regression, this PR adds more technically possible usages to the Kitchensink story.
API Changes
🟢 No API changes.
Screenshots
Impact Assessment
Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.
Impact level: 🟢 None - 🟢 Low
Due to an added Emotion class, there could be snapshots that need updating.
Release Readiness
QA instructions for reviewer
💻 EuiFormControlButton storybook
iconTypeandiconSidewithoutvaluealign as expected (iconSide="right"-> right aligned,iconSide="left"-> left aligned)Checklist before marking Ready for Review
QA: Tested in CodeSandbox and KibanaQA: Tested docs changesBreaking changes: Addedbreaking changelabel (if applicable)Reviewer checklist