Stores the element that will contain the portal. By default, it will be the body of the document.

Code examples

const container = document.getElementById("container");
function App() {
return (
<PortalContext.Provider value={container}>
<Portal />

Stay tuned

Join 1,000+ subscribers and receive monthly tips & updates on new Ariakit content.

No spam. Unsubscribe anytime. Read latest issue