Skip to content

Vizel API / core/src / createVizelPortalElement

Function: createVizelPortalElement()

ts
function createVizelPortalElement(layer?): HTMLDivElement;

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

Create a portal element with proper styling.

Creates a container div for portal content with appropriate positioning and z-index based on the specified layer.

Parameters

ParameterTypeDefault valueDescription
layer"dropdown" | "modal" | "tooltip""dropdown"The z-index layer for the portal element

Returns

HTMLDivElement

A configured portal element

Example

typescript
const element = createVizelPortalElement("dropdown");
element.appendChild(menuContent);
getVizelPortalContainer().appendChild(element);

Released under the MIT License.