Skip to content

Vizel API / core/src / mountToVizelPortal

Function: mountToVizelPortal()

ts
function mountToVizelPortal(content, options?): HTMLDivElement;

Defined in: packages/core/src/controllers/portal.ts:121

Mount an element to the portal container.

Parameters

ParameterTypeDescription
contentHTMLElementThe content element to mount
optionsVizelMountPortalOptionsMount options

Returns

HTMLDivElement

The wrapper element that was added to the portal

Example

typescript
const wrapper = mountToVizelPortal(menuElement, { layer: "dropdown" });
// Later, to unmount:
unmountFromVizelPortal(wrapper);

Released under the MIT License.