Skip to content

Portal

function Portal(__namedParameters): Element;

Renders children as a fullscreen absolute overlay on top of the main tree.

Useful for modals, notifications, and dropdowns that should paint above all other content.

ParameterType
__namedParametersPortalProps

Element

{showModal && (
<Portal>
<Box style={{ justifyContent: "center", alignItems: "center", height: "100%" }}>
<Box style={{ border: "round", padding: 2, bg: "black" }}>
<Text>I'm an overlay!</Text>
</Box>
</Box>
</Portal>
)}

PropertyTypeDescription
children?ReactNodeContent to render in the overlay layer.
zIndex?numberStack order (higher = on top). Default 1000.