portal

fun <C : HTMLElement> RenderContext.portal(classes: String? = null, id: String? = null, scope: ScopeContext.() -> Unit = {}, tag: TagFactory<Tag<C>>, content: Tag<C>.(close: suspend (Unit) -> Unit) -> Unit = {})

With Portalling a rendered overlay will be rendered outside of the clipping ancestors to avoid clipping. Therefore, a portalRoot is needed as last element in the document.body.

See https://floating-ui.com/docs/misc#clipping for more information.

A Portal might have a reference element. When the reference element is removed from the DOM, the portal will either. The reference element is always the receiver Type Tag of the portal extension function.


fun RenderContext.portal(classes: String? = null, id: String? = null, scope: ScopeContext.() -> Unit = {}, content: Tag<HTMLDivElement>.(close: suspend (Unit) -> Unit) -> Unit)

See also