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
| Parameter | Type | Description |
|---|---|---|
content | HTMLElement | The content element to mount |
options | VizelMountPortalOptions | Mount 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);