Portal

Layout

Takes a block

Its block, drawn into a node somebody else's code owns: an element a script hands over, or a ref: handle. When into: names another node the block moves there with its nodes and state; null keeps it aside until a node comes back; it goes when the page, branch or list item it is written in leaves. What is inside belongs to where it is written: its handlers, emit and lifetimes.

Portal(into: …) { … }

Example

Stack(ref: panel) Portal(into: panel) { Text("Drawn inside the stack") }

Renders with the class wf-portal, stable across releases, so a stylesheet may target it.

Props of Portal
Prop Type Meaning
into: Any (required)

Where it draws: an element, a ref: handle, or null to keep it aside; read again whenever what it reads changes

Attribute families: global, aria, data. Plus the universal props on every element: animate:, exit:, speed:, class:, ref:.