Skip to content

Conversation

@mgadewoll
Copy link
Contributor

@mgadewoll mgadewoll commented Sep 15, 2025

Summary

closes https://github.com/elastic/eui-private/issues/351

Important

This PR merges into a feature branch.

This PR implements two new components: EuiFormAppend and EuiFormPrepend.
These components are meant to be passed into form layout append and prepend slots to ensure a cohesive layout and styling.
These two components are meant to replace the current generic slot API, but for the initial introduction this implementation ensures a backwards compatible usage to make the update process smoother. This currently means that the previous usages of passing other components to the append/prepend slots still works and will results in mostly identical visual output.

Once consumers are updated fully, the idea is to remove the additional style rules that ensure backwards compatibility and rely on usages of EuiFormAppend and EuiFormPrepend only. Other usages would then result in unexpected visual output and indicate misusage.

Changes

  • Added EuiFormAppend and EuiFormPrepend components (components, docs, tests)
  • Added support for type="span" on EuiFormLabel to support using visual-only form labels
  • Updated EuiFormLabel to render a span if no htmlFor is passed
  • Updated EuiFormControlLayout to use EuiFormAppend and EuiFormPrepend
  • Updated form components EuiFormAppend/EuiFormPrepend as needed (EuiAutoRefresh, EuiColorPicker)
    • ⚠️ Breaking Change: Updated EuiQuickSelectPopover in EuiSuperDatePicker to use EuiFormPrepend: This results in more restricted quickSelectButtonProps as they reflect EuiFormPrepend instead of generic EuiButtonEmpty props.
  • Updated EuiColorPicker to ensure id is correctly passed onto the internal EuiFormControlLayout

Why are we making this change?

💅 UI consistency: This update is part of the Visual Refresh project and it's purpose is to ensure a cohesive visual output for form layout append/prepend elements.

Screenshots #

Previous "generic slot" usage

before after
Screenshot 2025-09-15 at 12 56 05 Screenshot 2025-09-15 at 12 55 41

New EuiFormAppend/Prepend usage

LIGHT DARK
Screenshot 2025-09-15 at 12 57 11 Screenshot 2025-09-15 at 12 57 16

EuiAutoRefresh

before after
Screenshot 2025-09-15 at 13 00 21 Screenshot 2025-09-15 at 13 00 15

EuiSuperDatePicker

before after
Screenshot 2025-09-15 at 13 03 04 Screenshot 2025-09-15 at 13 03 11

EuiColorPicker

before after
Screenshot 2025-09-15 at 13 01 34 Screenshot 2025-09-15 at 13 01 40

Impact to users

⚠️ The update to quickSelectButtonProps on EuiSuperDatePicker maybe cause breaking changes as it reflects a more restricted prop type for EuiFormPrepend instead of EuiButtonEmpty.

🟢 There are no usages of quickSelectButtonProps on EuiSuperDatePicker or EuiQuickSelectPopover directly in Kibana or Cloud.

ℹ️ The backwards compatibility of the changes ensures that existing Kibana usages work as expected.
We do however want to update simple Kibana usages to use EuiFormAppend/EuiFormPrepend already to drive adoption. This will be done as an additional step and linked here once available.

Deployment

💻 Kibana instance (credentials)

ℹ️ This instance currently does not have any usage updates yet.

QA

  • review the added EuiFormAppend/EuiFormPrepend components and their usage in append/prepend usage and ensure it matches design specs (figma, figma)
  • verify there is no regression for append/prepend between feature branch and staging
  • verify there is no regression for append/prepend in Amsterdam (feature branch, staging)
  • review the new and old API and verify both result in expected visual output (Storybook)
  • review the updated documentation
  • verify EuiSuperDatePicker's quick select button looks/works as expected (feature branch, staging)
  • verify EuiAutoRefresh looks according to new design specs (staging)
  • verify EuiColorPicker has no regression (feature branch, staging)

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)

@mgadewoll mgadewoll self-assigned this Sep 15, 2025
@mgadewoll mgadewoll added visual refresh breaking change PRs with breaking changes. (Don't delete - used for automation) labels Sep 15, 2025
@github-actions
Copy link

github-actions bot commented Sep 15, 2025

This PR contains breaking changes. The opener of this pull request is asked to perform the following due diligence steps below, to assist EUI in our next Kibana upgrade:

  • If this PR contains prop/API changes:
    • Search through Kibana for <EuiComponent usages (example search)
    • In the PR description or in a PR comment, include a count or list with the number of component usages in Kibana that will need to be updated (if that amount is "none", include that information as well)
  • If this PR contains CSS changes:
    • Search through Kibana for the changed EUI selectors, e.g. .euiComponent (example search)
    • In the PR description or in a PR comment, include a count or list with the number of custom CSS overrides in Kibana that will need to be updated (if that amount is "none", include that information as well)
  • 🔍 Tip: When searching through Kibana, consider excluding **/target, **/*.snap, **/*.storyshot files to reduce noise and only look at source code usages
  • ⚠️ For extremely risky changes, the EUI team should potentially consider the following precautions:
    • Using a pre-release release candidate to test Kibana CI ahead of time
    • Using kibana-a-la-carte for manual QA, and to give other Kibana teams a staging server to quickly test against

@mgadewoll
Copy link
Contributor Author

mgadewoll commented Sep 17, 2025

ℹ️ Initial design feedback:

  • change append/prepend focus to :focus-visible
  • [-] remove added automatic <label> linking (focusing the input by clicking the append/prepend isn't wanted) - this would mean we can't use <label> at all and change how it works currently towards using e.g. aria-labelledby instead
    • for semantics and Accessibility it's correct to link <label> elements. This has already been done before, only the examples did not have an id applied that would trigger the linking. Imho it's correct to showcase proper id usage in the docs.
  • remove the testing stories that showcase the old API

@mgadewoll mgadewoll force-pushed the inputs/351-refactor-append-prepend branch from e870cba to 6dc14e7 Compare December 12, 2025 16:37
@mgadewoll mgadewoll changed the base branch from feat/visual-refresh-append-prepend-updates to main December 12, 2025 16:43
@mgadewoll
Copy link
Contributor Author

mgadewoll commented Dec 12, 2025

ℹ️ I rebased this branch and changed the target merge branch to main (this branch and the target branch were very much outdated 💀)
This branch already contains the additional button changes from #8948 and we can create a QA environment anyway from this branch (with local packages or snapshot release from a temporary branch)

EDIT: The branch was rebased again with the reinstated feature branch feat/visual-refresh-append-prepend-updates, as we'll be adding additional design updates to form append/prepends.

@mgadewoll mgadewoll force-pushed the inputs/351-refactor-append-prepend branch from 6dc14e7 to dde1d94 Compare January 5, 2026 10:00
@mgadewoll mgadewoll changed the base branch from main to feat/visual-refresh-append-prepend-updates January 5, 2026 10:00
@mgadewoll mgadewoll force-pushed the inputs/351-refactor-append-prepend branch from dde1d94 to 8c1081c Compare January 5, 2026 10:24
@mgadewoll mgadewoll marked this pull request as ready for review January 5, 2026 14:05
@mgadewoll mgadewoll requested a review from a team as a code owner January 5, 2026 14:05
{children}
</legend>
);
} else if (type === 'span') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

💭 I'm wondering if we also want to update this to else if (type === 'span' || !htmlFor) to prevent rendering a <label> when the input linking is not applied as a <label> would expect a relation to a linked element.

This would likely affect more tests on Kibana side, as I'm not sure how diligently the inputId is applied.

Copy link
Member

Choose a reason for hiding this comment

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

I think it makes sense to check for !htmlFor. We're already introducing changes that will likely affect Kibana tests, so as long as this wouldn't result in breaking unreasonable number of them that would need manual updates, I'd say we should go with it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Considering this will already be a breaking change and we'll have a QA phase, I think it should be reasonable to include the update in the overall append/prepend update feature. We'll merge this into a feature branch anyway, worst case we can revert if it causes to much trouble.

Added in 4da2bbe.
I also updated the docs to try and explain the different scenarios more clearly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Fyi, the potential test failures I'd expect here are:

  • snapshots (<span> instead of <label> element is rendered)
  • selectors not available if a test checks for a label role

As this is on the EuiFormLabel component, it could happen across all of Kibana, it's not directly related to the Append/Prepend change.

@tkajtoch tkajtoch self-requested a review January 5, 2026 17:24
@mgadewoll mgadewoll force-pushed the inputs/351-refactor-append-prepend branch from 377d296 to 0e50bb0 Compare January 6, 2026 10:01
@tkajtoch
Copy link
Member

tkajtoch commented Jan 6, 2026

Thank you for addressing my comments! Code changes look good, I'm currently going through QA steps to verify everything. I opened #9293 to have a testing environment for the feature branch

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

Copy link
Member

@tkajtoch tkajtoch left a comment

Choose a reason for hiding this comment

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

Code changes look great, QA passed. LGTM

@mgadewoll mgadewoll merged commit fee46b7 into elastic:feat/visual-refresh-append-prepend-updates Jan 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change PRs with breaking changes. (Don't delete - used for automation) visual refresh

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants