React component used to render children outside the DOM hierarchy of the parent component
npm install @chakra-ui/portalA wrapper for rendering components in React Portals, with support for nested
portals and stacking.
``sh
yarn add @chakra-ui/portal
npm i @chakra-ui/portal
`
`jsx`
import { Portal, PortalManager } from "@chakra-ui/portal"
Render the PortalManager once at the root of your application
`jsx`
function App() {
return (
)
}
Portals are render into the portal manager's node by default not
document.body.
` Welcomejsx`
Nesting portal can be very useful to build complex widgets like nested menu,
popovers, modal, etc.
`jsx`
This is a portal.
You can also portal elements into a custom containers. Simply pass a
containerRef prop that points to the node of that element.
`jsx``
<>
Hello world
>