Skip to content

Conversation

@tsullivan
Copy link
Member

@tsullivan tsullivan commented Sep 30, 2025

New Managed Flyout System

This represents a significant evolution in the flyout system: a hook-based manager system with automatic context detection and support for complex flyout workflows.


Summary of API changes

Change Component API Brief description and documentation
New optional prop EuiFlyout session? ('start' | 'never' | 'inherit', optional - defaults to inherit) Enable flyout session management. Read more
Documentation: https://eui.elastic.co/pr_9068/docs/components/containers/flyout/#EuiFlyout-prop-session
New optional prop EuiFlyout onActive? (() => void, optional) Callback fired when the flyout becomes active/visible.
Documentation: https://eui.elastic.co/pr_9068/docs/components/containers/flyout/#EuiFlyout-prop-onActive
New optional prop EuiFlyout resizable? (boolean, optional - defaults to false) A new way to create resizable flyouts available directly in EuiFlyout - no EuiFlyoutResizable necessary. The resizable prop is dynamic which allows toggling between resizable state without whole-component rerenders
This makes the old EuiFlyoutResizable component obsolete (but it still works exactly like before). We may officially deprecate it in near future, but that's not the goal of this project. Read more
Documentation: https://eui.elastic.co/pr_9068/docs/components/containers/flyout/#resizable-flyout
New optional prop EuiFlyout onResize? Documentation: https://eui.elastic.co/pr_9068/docs/components/containers/flyout/#EuiFlyout-prop-onResize
New optional prop EuiFlyout minWidth? (number, optional) Brings feature parity with EuiFlyoutResizable. Use with resizabe={true} to set a minimum width of the flyout.
Documentation: https://eui.elastic.co/pr_9068/docs/components/containers/flyout/#resizable-flyout
New optional prop EuiFlyout flyoutMenuProps? (EuiFlyoutMenuProps, optional) Allows configuring certain aspects of the flyout menu like the title or custom action buttons. Read more
Documentation: https://eui.elastic.co/pr_9068/docs/components/containers/flyout/#flyout-menu
New optional prop EuiFlyout hasChildBackground? Documentation: https://eui.elastic.co/pr_9068/docs/components/containers/flyout/#EuiFlyout-prop-hasChildBackground
ref prop update EuiFlyout ref? (React.Ref, optional) Breaking change
Legacy string refs are no longer supported with EuiFlyout. Use modern React refs like useRef instead. Read more
Removed old flyout session system EuiFlyoutSessionProvider
useEuiFlyoutSession
EuiFlyoutSessionApi
EuiFlyoutSessionConfig
EuiFlyoutSessionRenderContext
- The initial, experimental flyout system implementation has been removed. Read more
Removed EuiFlyoutChild

ADDED - New Public-Facing Features

1. New Manager System

A comprehensive new "manager" system for centralized management of flyout sessions (src/components/flyout/manager/):

Core Component:

  • EuiFlyout: Same flyout component that developers are accustomed to

Session Management Props:

  • session prop on EuiFlyout with three modes:
    • 'start' - Creates a new flyout session (for main flyouts)
    • 'inherit' - (default) Inherits existing session if active
    • 'never' - Opts out of session management

Required EuiFlyoutMenu:
Managed flyouts require an EuiFlyoutMenu at the top, which is automatically rendered when you provide the necessary props.

  • flyoutMenuProps.title - (Required, or provide aria-label) Prop that provides the title for the automatically rendered EuiFlyoutMenu. Additional properties in flyoutMenuProps allow further customization of the menu (back button, history items, custom actions, etc.).

Synchronizing local state with the visible flyout session:
Since flyout sessions can be programmatically activated, i.e the history navigation system can reactivate them, you may want to have a local state that is kept in sync with the active session. These callbacks can be used to update your local state variables:

  • onActive callback - Fires when flyout becomes active/visible (new prop)
  • onClose callback - Fires when flyout is closed (not a new prop)

The new manager system uses use-sync-external-store and a singleton store pattern for cross-React-root state sharing.

2. New Flyout Menu Component

  • EuiFlyoutMenu and EuiFlyoutMenuProps: A new component for rendering a top menu bar in EuiFlyout.
  • The component uses internal context to support a "Back" button and a "History popover" control, when used within a managed flyout context.

3. resizable prop.

EuiFlyoutResizable was a complex wrapper that managed all resizing and state logic internally. The logic has been moved to an internal hook, which is now integrated directly into the main flyout component.

  • EuiFlyout now supports a resizable boolean prop
  • EuiFlyoutResizable is still supported, but is just a wrapper for EuiFlyout with resizable set to true.

REMOVED - Earlier iteration of the Flyout System Feature

An earlier pre-release iteration of the Flyout System was in main but is now being removed.

1. Old Session System

The entire API of the earlier version is being removed:

  • EuiFlyoutSessionProvider
  • useEuiFlyoutSession()
  • EuiFlyoutSessionApi
  • EuiFlyoutSessionConfig
  • EuiFlyoutSessionOpenChildOptions
  • EuiFlyoutSessionOpenMainOptions
  • EuiFlyoutSessionOpenGroupOptions
  • EuiFlyoutSessionProviderComponentProps
  • EuiFlyoutSessionRenderContext

2. Old Child Flyout Implementation

  • Standalone EuiFlyoutChild component (replaced with managed version)

The key difference from the old session system is that it used render props; the new manager system uses a centralized state store with hooks. The old system required explicit provider wrapping; the new system automatically detects when to use managed behavior.

Number of component usages in Kibana that will need to be updated: 0


Screenshots #

flyout system demo

Impact to users #

BREAKING CHANGE - String Refs No Longer Supported

EuiFlyout is a forwardRef component that previously had loose typing allowing string refs. It now enforces strict typing that only accepts modern ref patterns. Specifically, this could impact you in two scenarios:

  1. If you were passing a string ref to EuiFlyout, you will need to pass an HTML element ref instead:
    const ref = useRef<HTMLDivElement>(null);
    <EuiFlyout ref={ref}>
        <div>Hello</div>
    </EuiFlyout>
  2. If you were using styled-components to wrap EuiFlyout, your component implicitly becomes a string ref component. You will need to add ref={null} to your component:
    const StyledEuiFlyout = styled(EuiFlyout)`
    padding: 16px;
    `;
    <StyledEuiFlyout ref={null}>
        <div>Hello</div>
    </StyledEuiFlyout>

Number of component usages in Kibana that will need to be updated: 1

  1. fleet/sections/agent_policy/list_page/components/create_agent_policy.tsx

Flyout overlay mask z-index value update

Overlay masks are now siblings of flyouts, which required a change to the mask's z-index value. Now, flyout overlay masks use z-index value of levels.flyout - 1 making it more predictable.

QA

Remove or strikethrough items that do not apply to your PR.

PR Mergeability / Release readiness checklist

We must ensure this feature has everything it needs to be a publicly available feature in EUI before this branch is merged into main. Please ensure the following are completed before merging this PR:

  • List explicitly what has been added, removed, or changed in the public facing API.
  • For each of the above, please ensure documentation has been updated accordingly.
  • Please provide production(https://eui.elastic.co/) links to all relevant documentation. (which covers, at a minimum, the API changes listed above).
  • The Impact section must be filled out and call out explicitly how users upgrading to the EUI version containing this feature will be impacted.
    • If it is all new code and features, there will be no impact.
    • If anything existing in EUI has changed either visually or functionally, it must highlighted.
  • Figma has been updated to reflect the changes in this PR (or is planned to be updated by the time this feature is published) - please provide links.
  • @JasonStoltz has reviewed the above and approved this PR

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)

@tsullivan tsullivan self-assigned this Sep 30, 2025
@tsullivan tsullivan added skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) and removed skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) labels Sep 30, 2025
@tsullivan tsullivan changed the title Feature: Flyout System Feature: Flyout System [Beta] Oct 6, 2025
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @tsullivan

@JasonStoltz
Copy link
Member

JasonStoltz commented Oct 15, 2025

@tsullivan @tkajtoch

I've added a PR mergeability / release readiness checklist to the PR description. Please make sure everything listed there is accounted for before merging this PR to main.

}));

describe('EuiFlyout', () => {
// TODO: Add `maskProps` to `childProps` again when EuiOverlayMask
Copy link
Member

Choose a reason for hiding this comment

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

@tkajtoch fix this

Copy link
Member

Choose a reason for hiding this comment

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

Addressed in #9155


export type EuiFlyoutOpenState = 'opening' | 'open';

export const useEuiFlyoutOpenState = () => {
Copy link
Member

Choose a reason for hiding this comment

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

@tkajtoch remove unused hook

Copy link
Member

Choose a reason for hiding this comment

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

Addressed in #9155

@JasonStoltz
Copy link
Member

Thanks for updating this issue with the "Summary of API changes" table and handling the other release readiness items. It looks good to me on that front 👍

@tsullivan
Copy link
Member Author

/ci

@tsullivan
Copy link
Member Author

Also, quick question -- as a user, when I see this: https://eui.elastic.co/pr_9068/docs/components/containers/flyout/#flyout-menu ... is this something that I should use generally or is this just available for use in managed Flyouts? And how does it correspond to flyoutMenuProps? As a user looking at these docs, I'm super confused.

@JasonStoltz I have updated the docs on EuiFlyoutMenu, so it should be clear now. It is a private component, and controlled through the flyoutMenuProps that is passed to `EuiFlyout.

32edff0

@JasonStoltz
Copy link
Member

@tsullivan Thank you Tim! From the review point of view, I'm good with this in terms of release. I didn't actually approve the PR because I haven't looked at the code -- someone else from the EUI team can provide that.

@tsullivan tsullivan requested a review from tkajtoch October 28, 2025 16:36
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @tsullivan

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @tsullivan

@ryankeairns ryankeairns self-requested a review October 28, 2025 21:55
@ryankeairns
Copy link
Contributor

Feedback on docs

1. Title overflows menu bar

  • Since this is a main flyout, the title should be passed to the EuiFlyoutHeader section (we discussed this in Slack; perhaps the API was changed and the docs were not?)
  • For child flyouts that can have a title in this place, we should use truncation to avoid overflowing
CleanShot 2025-10-28 at 14 54 24@2x

2. Page structure

  • Instead of a separate page - which also makes the parent accordion a page - we could include the session management section in the same/main flyout page. This could be under Usage or under Guidelines (see the Panel page for an example)

@ryankeairns
Copy link
Contributor

Feedback on docs

1. Title overflows menu bar

  • Since this is a main flyout, the title should be passed to the EuiFlyoutHeader section (we discussed this in Slack; perhaps the API was changed and the docs were not?)
  • For child flyouts that can have a title in this place, we should use truncation to avoid overflowing
CleanShot 2025-10-28 at 14 54 24@2x **2. Page structure**
  • Instead of a separate page - which also makes the parent accordion a page - we could include the session management section in the same/main flyout page. This could be under Usage or under Guidelines (see the Panel page for an example)

This is addressed in #9150

@tkajtoch
Copy link
Member

We can disregard the changelog CI step reporting waiting for status to be reported. We updated it earlier this week, and it behaves buggy. I manually confirmed we have all the required changelog files.

I'm wrapping up my final QA against Kibana and should approve the PR within the next few hours.

@tsullivan
Copy link
Member Author

  1. Page structure
    Instead of a separate page - which also makes the parent accordion a page - we could include the session management section in the same/main flyout page. This could be under Usage or under Guidelines (see the Panel page for an example)

Thanks @ryankeairns I have filed this to work on as a separate change. Hope that is OK.

@tkajtoch
Copy link
Member

I have finished testing the changes against Kibana and found no regressions. There are a few places where Kibana overrides EuiFlyout z-index styles to render the AI Assistant flyout on top of another open flyout (sounds familiar, huh? see an example), but these will be adjusted in next week's upgrade PR which I'm responsible for.

LGTM 🚢

@tkajtoch tkajtoch merged commit e500915 into main Oct 30, 2025
8 checks passed
@tkajtoch tkajtoch deleted the feat/flyout-system branch October 30, 2025 16:10
@tsullivan tsullivan restored the feat/flyout-system branch October 30, 2025 16:13
@tsullivan tsullivan deleted the feat/flyout-system branch October 30, 2025 16:14
tkajtoch added a commit to tkajtoch/eui that referenced this pull request Nov 4, 2025
tsullivan added a commit to tsullivan/eui that referenced this pull request Nov 5, 2025
Co-authored-by: Clint Andrew Hall <[email protected]>
Co-authored-by: Weronika Olejniczak <[email protected]>
Co-authored-by: Tomasz Kajtoch <[email protected]>
Co-authored-by: Arturo Castillo Delgado <[email protected]>
Co-authored-by: Paulina Shakirova <[email protected]>
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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants