FlyoutConfig

FlyoutConfig

Configuration for opening a flyout via {@link showFlyout}.

type FlyoutConfig = {
  /**
   * Heading text shown in the flyout's header. Also becomes the
   * flyout's accessible name unless an `aria-label` was set by
   * the author. When omitted, the flyout keeps its current
   * heading.
   */
  heading?: string | undefined;
  /**
   * Content to show. A string is rendered as plain text; pass a
   * `Node` (element or fragment) for rich content. The flyout's
   * existing light-DOM children are **replaced** — a second
   * `showFlyout` swaps content in place, it never stacks. When
   * omitted, the flyout opens with whatever content it already
   * has (e.g. declaratively slotted markup).
   */
  content?: string | Node | undefined;
  /**
   * Fill the visible block-size in gutter and docked modes instead of
   * sizing the panel to its content. The content region scrolls
   * independently. Overlay drawers already fill the viewport.
   */
  fullHeight?: boolean | undefined;
  /**
   * Triggering element whose block-start edge the in-grid flyout
   * should align with. The flyout stays in the page's normal scroll
   * flow, shifting upward only while needed to fit the visible
   * scrollport. Content taller than that scrollport scrolls inside the
   * panel. Overlay drawers ignore this geometry and remain
   * viewport-fixed. Its outermost containing `esp-page` also supplies
   * the default flyout scope. When omitted, the flyout starts at the
   * top of the page's content row.
   */
  anchor?: HTMLElement | undefined;
  /**
   * Element to return focus to when the flyout closes — pass the
   * triggering control. In the in-grid modes (where opening never
   * moves focus) it is focused only if focus is inside the panel at
   * close; in the overlay-drawer mode (a modal, which does move focus
   * in) it overrides the automatic restore-to-opener.
   */
  returnFocusTo?: HTMLElement | undefined;
}
Components API Guides Getting started Styling Espalier Browser support GitHub npm package Taproot I/O