@diana-ui/portal
TypeScript icon, indicating that this package has built-in type declarations

4.0.12 • Public • Published

@diana-ui/portal

The Portal component uses React Portals to render a DOM element outside the DOM hierarchy of the parent element, namely as a child of the <body>.

This component was implemented for the Popover to be able to visibly overflow out of parents that have overflow-hidden. An example of this can be found when a Dropdown (that used the Popover) is rendered inside a Modal.

The Portal is absolutely positioned, just below its parent element and aligned on the left side. To calculate this position, the parent element's position is used via the parentRef prop.

/@diana-ui/portal/

    Package Sidebar

    Install

    npm i @diana-ui/portal

    Weekly Downloads

    21

    Version

    4.0.12

    License

    MIT

    Unpacked Size

    60.9 kB

    Total Files

    12

    Last publish

    Collaborators

    • ymetis