Wondering what’s next for npm?Check out our public roadmap! »

    @marko-tags/portal

    1.2.1 • Public • Published


    @marko-tags/portal
    API Stability NPM Version Downloads

    Portals provide a way to render children into a DOM node that exists outside the DOM hierarchy of the parent component.

    A typical use case for portals is when a parent component has an overflow: hidden or z-index style, but you need the child to visually “break out” of its container. For example, dialogs and tooltips.

    Installation

    npm install @marko-tags/portal

    Example

    By default, the portal renders into document.body:

    <portal>
       ...content here...
    </portal>

    You can set a custom target container using a DOM id:

    <portal target="some-id">
       ...content here...
    </portal>

    Or by passing a DOM Node:

    <portal target=someNode>
       ...content here...
    </portal>

    Install

    npm i @marko-tags/portal

    DownloadsWeekly Downloads

    263

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    5.87 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar