Skip to main content

Portal

Used to render a component outside the DOM hierarchy of the parent component.

Anatomy

This component is a utility and does not render any DOM elements.

Import

import { Portal } from '@pluralsight/react'

Usage

Basic

Result
Loading...
Live Editor

Behavior

There are no behaviors associated with this component.

API

Parameters

interface PortalProps {
mount?: HTMLElement
key?: string
}
  1. mount: The DOM node to mount the portal to. Defaults to document.body.
  2. key: The key to use for the portal. Defaults to undefined.

Accessibility

There is no special accessibility considerations for this component.