igx-overlay

March 30, 2026 ยท View on GitHub

The overlay service allows users to show components on overlay div above all other elements in the page. A walk through of how to get started can be found here

Key Features

  • Popover API Integration: Uses the HTML Popover API for improved z-index management and automatic top-layer placement
  • Flexible Positioning: Multiple position strategies (global, connected, auto, elastic, container)
  • Scroll Strategies: Handle scroll behavior with NoOp, Block, Close, and Absolute strategies
  • Modal Support: Optional modal backdrop with configurable close-on-outside-click behavior
  • Animation Support: Built-in support for open/close animations

Usage

With igxToggleDirective

<div igxToggle>
</div>
@ViewChild(IgxToggleDirective) public igxToggle: IgxToggleDirective;
this.igxToggle.toggle();

Directly through the service

this.overlay.show(component);

Getting Started

Dependencies

To use the IgxOverlay import the IgxOverlayService:

import { IgxOverlayService } from "igniteui-angular";

Then initialize the overlay settings, only if you need some different from default ones.

overlaySettings: OverlaySettings = {
    target: new Point(0, 0),
    positionStrategy: new GlobalPositionStrategy(),
    scrollStrategy: new NoOpScrollStrategy(),
    modal: true,
    closeOnOutsideClick: true
};

Finally show the component you need with the overlay settings you need:

this.overlay.show(component, overlaySettings);

API

Interfaces
IPositionStrategy
NameTypeDescription
positionSettingsPositionSettingsSettings to apply to this position strategy
OverlaySettings
NameTypeDescription
targetPointHTMLElement
positionStrategyIPositionStrategyPosition strategy to use with this settings
scrollStrategyIScrollStrategyScroll strategy to use with this settings
modalbooleanSet if the overlay should be in modal mode
closeOnOutsideClickbooleanSet if the overlay should closed on outside click
outletIgxOverlayOutletDirective or ElementRefDeprecated. Set the outlet container to attach the overlay to
PositionSettings
NameTypeDescription
horizontalDirectionHorizontalAlignmentDirection in which the component should show
verticalDirectionVerticalAlignmentDirection in which the component should show
horizontalStartPointHorizontalAlignmentTarget's starting point
verticalStartPointVerticalAlignmentTarget's starting point
openAnimationAnimationMetadataAnimationMetadata[]
closeAnimationAnimationMetadataAnimationMetadata[]
minSizeSizeThe size up to which element may shrink when shown in elastic position strategy
OverlayCreateSettings extends OverlaySettings
NameTypeDescription
injectorInjectorAn Injector instance to add in the created component ref's injectors tree
Methods
IgxOverlayService
NameDescriptionParameters
attachGenerates Id. Provide this Id when call show(id, settings?) methodelement, overlaySettings?
attachGenerates Id. Provide this Id when call show(id, settings?) methodcomponent, overlayCreateSettings?,
attachGenerates Id. Provide this Id when call show(id, settings?) methodcomponent, viewContainerRef, overlaySettings?
showShows the provided component on the overlayid, overlaySettings?
hideHides the component with the ID provided as a parameterid
hideAllHides all the components and the overlay-
detachRemove overlay with the provided idid
detachAllRemove all the overlays-
repositionRepositions the native element of the component with provided idid
setOffsetOffsets the content along the corresponding axis by the provided amount with optional offsetMode that determines whether to add (by default) or set the offset values with OffsetMode.Add and OffsetMode.Setid, deltaX, deltaY, offsetMode?
IPositionStrategy
NameDescriptionParameters
positionPositions provided elementelement
cloneClones the position strategy and its settings-
IScrollStrategy
NameDescriptionParameters
initializeInitialize the strategy. Should be called oncedocument, overlayService, id
attachAttaches the strategy-
detachDetaches the strategy-
static methods
NameDescriptionParameters
getPointFromPositionsSettingsCalculates the point from which the overlay should start showingsettings
createAbsoluteOverlaySettingsCreates overlay settings with global or container position strategy based on a preset position settingsposition?, useContainerStrategy?
createRelativeOverlaySettingsCreates overlay settings with auto, connected or elastic position strategy based on a preset position settingstarget, strategy?, position?
Events
IgxOverlayService
NameDescriptionCancelableParameters
openingEmitted before overlay showstrue
openedEmitted after overlay showsfalse
closingEmitted before overlay hidestrue
closedEmitted after overlay hidesfalse
contentAppendingEmitted before overlay's content is appendedfalse
contentAppendedEmitted after overlay's content is appendedfalse
animationStartingEmitted before animation is startedfalse