Skip to content

Properties

TypeDescription
refReact.Ref<HTMLElement>
React.RefObject<HTMLElement>
(optional) The ref of the element that will be used.
idstring(optional) The id used for the portal root element. Defaults to eufemia-portal-root. If an element with this id already exists in the DOM, it will be reused.
insideSelectorstring(optional) CSS selector for a container to place the portal root inside. The portal element is inserted as the first child of the matched element.
beforeSelectorstring(optional) CSS selector for a target element; the portal root will be inserted directly before the first matched element.
childrenReact.ReactNode(required) The content that will be placed in a React Portal.
[HTML attributes]various(optional) When used on PortalRoot.Provider, any extra HTML attributes (e.g. translate, lang, dir, data-*) are forwarded to the portal DOM element. Props on PortalRoot itself take precedence.