Lightbox Functions

close()

Closes the open popup.

It closes whichever popup is open, regardless of the component that calls it.

Site visitors can also close a popup themselves, with its close button, the Escape key, or by going to another page.

Method Declaration

Copy

Examples


getContext()

Deprecated. Use getPayload() instead.

Retrieves the payload of the open popup.

Method Declaration

Copy

Returns

Return Type:TPayload

Examples


getPayload()

Retrieves the payload of the open popup.

It returns the payload of whichever popup is open, regardless of the component that calls it, so call it from a component inside the popup.

It takes no arguments. In TypeScript, you can specify the payload's type in angle brackets, as in getPayload<QuickViewPayload | undefined>(). Use the type you specified for payload in open(), plus undefined. TypeScript doesn't check that the two match, so a different type gives you wrong types without an error. Without a type, the return type is unknown.

Method Declaration

Copy

Returns

Return Type:TPayload

Payload of the open popup.

undefined when no popup is open.

Examples


open()

Opens a popup over the current page.

Opening a popup closes any popup that's already open. If the popup is already open, it stays open, and its payload is replaced with the payload you specify, or with undefined if you omit payload.

Specify the popup by slug. Specifying it by pageId is deprecated, but still works.

Method Declaration

Copy

Method Parameters

optionsLightboxOpenOptions<TPayload>Required

Options for opening the popup.

Returns

Return Type:Promise<void>

Promise that resolves with no value once the popup is open. It rejects when the popup can't be opened, for example when no popup has the slug you specify.

Examples

Last updated: 1 November 2026

Did this help?