Back to Evergreen

Usage

docs/documentation/components/portal.mdx

7.1.9568 B
Original Source

Usage

The Portal component is a utility component to help with the ReactDOM.createPortal API. Learn more about portal on the official React docs.

Portals are used throughout Evergreen in components such as Overlay and Positioner to provide a robust way of rendering outside of the current DOM tree.

Example

jsx
<Portal>
  <Pane background="red" padding={24} position="fixed" bottom={0} right={0}>
    <Text color="white">Look ma, I am in a portal!</Text>
  </Pane>
</Portal>