@yamada-ui/portal
Version:
Yamada UI portal component
44 lines (41 loc) • 1.38 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { ReactNode, RefObject } from 'react';
interface PortalProps {
children: ReactNode;
/**
* If `true`, the portal will check if it is within a parent portal
* and append itself to the parent's portal node.
* This provides nesting for portals.
*
* If `false`, the portal will always append to `document.body`
* regardless of nesting. It is used to opt out of portal nesting.
*
* @default true
*/
appendToParentPortal?: boolean;
/**
* The `ref` to the component where the portal will be attached to.
*/
containerRef?: RefObject<HTMLElement | null>;
/**
* If `true`, the forwarding will be disabled.
*/
disabled?: boolean;
/**
* If `true`, the forwarding will be disabled.
*
* @deprecated Use `disabled` instead.
*/
isDisabled?: boolean;
}
/**
* `Portal` is a component that renders elements outside of the current `DOM` hierarchy.
*
* @see Docs https://yamada-ui.com/components/other/portal
*/
declare const Portal: {
({ appendToParentPortal, children, containerRef, isDisabled, disabled, }: PortalProps): string | number | boolean | Iterable<ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
displayName: string;
__ui__: string;
};
export { Portal, type PortalProps };