npm.io
7.1.0 • Published 9 months ago

@leafygreen-ui/portal

Licence
Apache-2.0
Version
7.1.0
Deps
2
Size
54 kB
Vulns
0
Weekly
0
Stars
271

Portal

npm (scoped)

View on MongoDB.design

Installation

PNPM
pnpm add @leafygreen-ui/portal
Yarn
yarn add @leafygreen-ui/portal
NPM
npm install @leafygreen-ui/portal

Example

import Portal from '@leafygreen-ui/portal';

<Portal>
  <div>
    Portals transport their children to a div that is appended to the end of the
    document.body to or a node that can be specified with a container prop.
  </div>
</Portal>;

Properties

Prop Type Description Default
container DOM Node Sets the container node, which will contain all of the portaled content. If no container is supplied, a div will be created and apened to the end of the document.body. document.createElement('div')
children node The children will be rendered inside of the portaled container.