Portal

Portal displays content in outside of the DOM hierarchy.

import { Portal } from '@cerberus-design/react'

Usage

API

export interface PortalProps {
container?: Element | DocumentFragment
key?: null | string
}
define function Portal(props: PropsWithChildren<PortalProps>): ReactPortal | null

Props

The Portal component accepts the following props:

NameDefaultDescription
containerdocument.bodyThe mounted element to place the children contents within.
keynullA unique key to attached to the Portal instance.

On this page