import { ReactNode, RefObject } from 'react'; import { type PortalLayer } from './portalRegistry'; export interface PortalProps { /** * The element you want to portal. */ children?: ReactNode; /** * The destination where to portal. * If provided, it will override the default portal container. * Accepts HTMLElement, RefObject, or null. */ container?: HTMLElement | RefObject | RefObject | null; /** * Whether to disable portal. * If true, it will be a normal component. * @default false */ disablePortal?: boolean; /** * The portal layer to use. * - 'alert': Portal to alert container (above root, sticky) * - 'default': Portal to default container (inside root, fixed) * @default 'default' */ layer?: PortalLayer; } /** * Renders its children into a DOM node outside the parent hierarchy. * * Without `container` the children go to the Mezzanine portal layer chosen by * `layer` (created on first use); `container` overrides the destination and * `disablePortal` keeps the children in place. * * Portaled content is client-only: the server and the hydration pass render * nothing, then the children are portaled once mounted, so hydration never * mismatches. With `disablePortal` the children are rendered in place on the * server as well. * * @example * ```tsx * import { Portal } from '@mezzanine-ui/react'; * * *
Rendered into the alert layer
*
* ``` * * @see Backdrop * @see Popper */ export default function Portal({ children, container: containerProp, disablePortal, layer, }: PortalProps): import("react/jsx-runtime").JSX.Element | null;