portal

v4.9.10arrow_drop_down
v4.9.10
v4.5.2
v3.9.2
STATUS
Passing
DOWNLOADS
309,588
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
4 years ago
SIZE
3 KB
The children to render into the `container`.
2 contributors
Install portal as a package?
Copied
npm i @bit/mui-org.material-ui.portal
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
chevron_left
chevron_right

The children to render into the container.

A node, component instance, or function that returns either. The container will have the portal children appended to it. By default, it uses the body of the top-level document object, so it’s simply document.body most of the time.

Disable the portal behavior. The children stay within it’s parent DOM hierarchy.

Callback fired once the children has been mounted into the container.

This prop will be deprecated and removed in v5, the ref can be used instead.

Portals provide a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component. Demos:

API:

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

Properties
NameTypeDescription
children
node

The children to render into the container.

container
function | React.Component | typeof Element === 'undefined' ? Object : Element

A node, component instance, or function that returns either. The container will have the portal children appended to it. By default, it uses the body of the top-level document object, so it’s simply document.body most of the time.

disablePortal
bool

Disable the portal behavior. The children stay within it’s parent DOM hierarchy.

onRendered
function

Callback fired once the children has been mounted into the container.

This prop will be deprecated and removed in v5, the ref can be used instead.

Help and resources