Skip to content

Popup

Properties

PropertyTypeDefaultDescription
modalbooleanfalseIndicates whether the popup is displayed as a modal.
contentAlignAnchorAlignSpecifies the alignment direction relative to the content. Possible values: 'left top', 'left center', 'left bottom', 'right top', 'right center', 'right bottom', 'center'.
coordinateMode'global'|'relative'|'none''relative'Sets the coordinate system for the popup.
anchorstring|HTMLElementSpecifies the relative position where the popup will open. Default is body.
anchorAlignAnchorAlignSpecifies the alignment direction relative to the anchor. Possible values: 'left top', 'left center', 'left bottom', 'right top', 'right center', 'right bottom', 'center'.
offsetXnumber0Changes the popup's X position (in pixels).
offsetYnumber0Changes the popup's Y position (in pixels).
lockOutsidebooleanfalsePrevents the content from extending beyond the viewport area.
alwaysOnTopbooleanfalsePlaces the popup at the highest z-index position.
prioritynumber0Defines the z-index priority when multiple popups are open.
nestbooleantrueManages nested popup structures.
autoFocusbooleantrueAutomatically sets focus to the content when the popup opens.
focusTargetstring|HTMLElementThe element that will receive focus when autoFocus is true.
hitAreasArray<HTMLElement>[]Sets valid areas to prevent auto-closing when clicking outside.
closeOnOutsideDownbooleanfalseCloses the popup when clicking outside.
closeOnEscapebooleanfalseCloses the popup when ESC key is pressed.
closeOnEventsArray<string>['close']Closes the popup when specific events occur.
openDelaynumber0Delay time when opening the popup (ms).
closeDelaynumber0Delay time when closing the popup (ms).
openOnTriggerAnchorTriggerAutomatically opens the popup when 'click' or 'over' events occur on the anchor element.

Methods

MethodParametersDescription
opendata?: anyOpens the popup. Used as an argument for opening and opened callback functions.
closereason?: anyCloses the popup. Used as an argument for closing and closed callback functions.
opening(callback: (content: HTMLElement, data: any) => void) => PopupMethodsCalled before the popup opens.
opened(callback: (content: HTMLElement, data: any) => void) => PopupMethodsCalled after the popup is fully opened. The data from the open method becomes the argument for the callback function.
closing(callback: (reason: any) => void) => PopupMethodsCalled just before the popup closes. The data from the close method becomes the reason value.
closed(callback: (reason: any) => void) => PopupMethodsCalled when the popup closes. The data from the close method becomes the reason value.
toggledata?: anyToggles the popup's open/close state.
invalidateRefreshes the popup's position.
destroyRemoves all components associated with this instance.

Events

EventTypeDescription
open(event: Event) => voidCalled when the popup opens.
close(event: Event) => voidCalled when the popup closes.
cancel-open(event: Event) => voidCalled when opening the popup is cancelled.
cancel-close(event: Event) => voidCalled when closing the popup is cancelled.