Skip to content

Conversation

@tsullivan
Copy link
Member

@tsullivan tsullivan commented Aug 26, 2025

Summary

Closes #8874
Depends on #8939

Why are we making this change?

Requirement for Flyout System. This PR is targeted to the flyout system feature branch.

Screenshots

Flyout.System.Fill.Mode.Demo.mp4

Impact to users

This gives developers the ability to show large-size "main" or "child" flyouts using the Flyout System.

QA

Remove or strikethrough items that do not apply to your 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 changed the base branch from main to feat/flyout-system August 26, 2025 20:49
@tsullivan tsullivan force-pushed the session-flyouts/fill-mode branch from b8ff0c8 to dc825bb Compare August 26, 2025 23:21
@tsullivan tsullivan force-pushed the session-flyouts/fill-mode branch from dc825bb to 0d95eea Compare September 2, 2025 16:03
@tsullivan tsullivan marked this pull request as ready for review September 2, 2025 16:35
@tsullivan tsullivan requested a review from a team as a code owner September 2, 2025 16:35
@tsullivan tsullivan force-pushed the session-flyouts/fill-mode branch from a8a0907 to 013239a Compare September 3, 2025 19:30
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@tkajtoch tkajtoch self-requested a review September 3, 2025 21:29
/**
* Composes all inline styles for a flyout based on its configuration
*/
export const composeFlyoutInlineStyles = (
Copy link
Member

Choose a reason for hiding this comment

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

This whole function feels quite difficult to follow. I'm not sure how exactly we can simplify this, but I'd like to get back to it when we have some more time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added this to the punch list. Were you thinking someone from SharedUX could do this? I think there are some devs on this team that have availability

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 good. I tested the changes in Storybook and can confirm that the fill mode works as expected.

We could probably make the implementation a bit cleaner, but I'm happy to merge this PR as is since it targets the feature branch. I plan to give the whole flyout directory a cleanup pass before releasing the flyout system publicly. Let's focus on getting all functionality implemented first, though 👍🏻

@tkajtoch tkajtoch merged commit 780899d into elastic:feat/flyout-system Sep 4, 2025
4 checks passed
tkajtoch pushed a commit that referenced this pull request Sep 4, 2025
@tsullivan tsullivan deleted the session-flyouts/fill-mode branch September 4, 2025 21:10
acstll pushed a commit to acstll/eui that referenced this pull request Sep 17, 2025
@tsullivan tsullivan mentioned this pull request Oct 24, 2025
18 tasks
tsullivan added a commit to elastic/kibana that referenced this pull request Jan 13, 2026
…3806)

~~Depends on elastic/eui#8982
~~Depends on elastic/eui#9202
~~Depends on #245515

This PR enhances the core UX offerings in Kibana with
`core.overlays.openSystemFlyout`.

### `core.overlays.openSystemFlyout`
Opens a system flyout that integrates with the EUI Flyout Manager. Using
a mount point would break the context propogation of the EUI Flyout
Manager, so this method accepts React elements directly rather than
`toMountPoint`.
```typescript
import React, { useRef } from 'react';
import { 
  EuiFlyoutBody, 
  EuiFlyoutFooter,
  EuiText,
  EuiButton,
  EuiButtonEmpty,
  EuiFlexGroup,
  EuiFlexItem 
} from '@elastic/eui';
import type { OverlayRef } from '@kbn/core-mount-utils-browser';

// Create a component or function that opens the system flyout
const openMySystemFlyout = (overlays) => {
  const flyoutRef = useRef<OverlayRef | null>(null);

  const handleClose = () => {
    if (flyoutRef.current) {
      flyoutRef.current.close();
    }
  };

  const FlyoutContent = () => (
    <>
      <EuiFlyoutBody>
        <EuiText>
          <p>This is a system flyout that integrates with EUI Flyout Manager.</p>
          <p>The header is automatically created from the title option.</p>
        </EuiText>
      </EuiFlyoutBody>
      <EuiFlyoutFooter>
        <EuiFlexGroup justifyContent="spaceBetween">
          <EuiFlexItem grow={false}>
            <EuiButtonEmpty onClick={handleClose}>
              Cancel
            </EuiButtonEmpty>
          </EuiFlexItem>
          <EuiFlexItem grow={false}>
            <EuiButton onClick={() => console.log('Save')} fill>
              Save
            </EuiButton>
          </EuiFlexItem>
        </EuiFlexGroup>
      </EuiFlyoutFooter>
    </>
  );

  flyoutRef.current = overlays.openSystemFlyout(<FlyoutContent />, {
    title: 'My System Flyout',
    type: 'overlay',
    size: 'm',
    maxWidth: 600,
    ownFocus: false,
    onClose: () => {
      console.log('System flyout closed');
      flyoutRef.current = null;
    },
    onActive: () => {
      console.log('System flyout became active');
    },
  });

  return flyoutRef.current;
};

// Open the flyout
const flyoutRef = openMySystemFlyout(overlays);

// Close the flyout programmatically from outside
flyoutRef.close();
```

The developer README for the Flyout System is
[here](https://github.com/elastic/eui/blob/feat/flyout-system/packages/eui/src/components/flyout/README.md).

### Example plugin

Along with the new service and documentation changes, a new example
plugin for developers is provided that shows different integration
patterns for the EUI flyout system.

**Screenshot of example plugin:**
<img width="1327" height="836" alt="image"
src="https://github.com/user-attachments/assets/9664f0cb-f793-4a8c-8a96-c46d069756dd"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Ania Kowalska <ania.kowalska@elastic.co>
Co-authored-by: Lene Gadewoll <lene.gadewoll@elastic.co>
Co-authored-by: Weronika Olejniczak <weronika.olejniczak@elastic.co>
Co-authored-by: Jorge Oliveira <jorge.oliveira@elastic.co>
Co-authored-by: Tomasz Kajtoch <tomasz.kajtoch@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
smith pushed a commit to smith/kibana that referenced this pull request Jan 16, 2026
…stic#233806)

~~Depends on elastic/eui#8982
~~Depends on elastic/eui#9202
~~Depends on elastic#245515

This PR enhances the core UX offerings in Kibana with
`core.overlays.openSystemFlyout`.

### `core.overlays.openSystemFlyout`
Opens a system flyout that integrates with the EUI Flyout Manager. Using
a mount point would break the context propogation of the EUI Flyout
Manager, so this method accepts React elements directly rather than
`toMountPoint`.
```typescript
import React, { useRef } from 'react';
import { 
  EuiFlyoutBody, 
  EuiFlyoutFooter,
  EuiText,
  EuiButton,
  EuiButtonEmpty,
  EuiFlexGroup,
  EuiFlexItem 
} from '@elastic/eui';
import type { OverlayRef } from '@kbn/core-mount-utils-browser';

// Create a component or function that opens the system flyout
const openMySystemFlyout = (overlays) => {
  const flyoutRef = useRef<OverlayRef | null>(null);

  const handleClose = () => {
    if (flyoutRef.current) {
      flyoutRef.current.close();
    }
  };

  const FlyoutContent = () => (
    <>
      <EuiFlyoutBody>
        <EuiText>
          <p>This is a system flyout that integrates with EUI Flyout Manager.</p>
          <p>The header is automatically created from the title option.</p>
        </EuiText>
      </EuiFlyoutBody>
      <EuiFlyoutFooter>
        <EuiFlexGroup justifyContent="spaceBetween">
          <EuiFlexItem grow={false}>
            <EuiButtonEmpty onClick={handleClose}>
              Cancel
            </EuiButtonEmpty>
          </EuiFlexItem>
          <EuiFlexItem grow={false}>
            <EuiButton onClick={() => console.log('Save')} fill>
              Save
            </EuiButton>
          </EuiFlexItem>
        </EuiFlexGroup>
      </EuiFlyoutFooter>
    </>
  );

  flyoutRef.current = overlays.openSystemFlyout(<FlyoutContent />, {
    title: 'My System Flyout',
    type: 'overlay',
    size: 'm',
    maxWidth: 600,
    ownFocus: false,
    onClose: () => {
      console.log('System flyout closed');
      flyoutRef.current = null;
    },
    onActive: () => {
      console.log('System flyout became active');
    },
  });

  return flyoutRef.current;
};

// Open the flyout
const flyoutRef = openMySystemFlyout(overlays);

// Close the flyout programmatically from outside
flyoutRef.close();
```

The developer README for the Flyout System is
[here](https://github.com/elastic/eui/blob/feat/flyout-system/packages/eui/src/components/flyout/README.md).

### Example plugin

Along with the new service and documentation changes, a new example
plugin for developers is provided that shows different integration
patterns for the EUI flyout system.

**Screenshot of example plugin:**
<img width="1327" height="836" alt="image"
src="https://github.com/user-attachments/assets/9664f0cb-f793-4a8c-8a96-c46d069756dd"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Ania Kowalska <ania.kowalska@elastic.co>
Co-authored-by: Lene Gadewoll <lene.gadewoll@elastic.co>
Co-authored-by: Weronika Olejniczak <weronika.olejniczak@elastic.co>
Co-authored-by: Jorge Oliveira <jorge.oliveira@elastic.co>
Co-authored-by: Tomasz Kajtoch <tomasz.kajtoch@elastic.co>
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Flyout System] Add support for a larger flyout in the new grouped layout

3 participants