Renders a React subtree in a different part of the DOM.
Import the component from the @minddrop/ui
package.
import { Portal } from '@minddrop/ui';
export default () => <Portal>Content</Portal>;
Anything you put inside this component will be rendered in a separate <div data-radix-portal>
element. By default, this element will be appended to document.body
but you can choose a different container by using the containerRef
prop.
Prop | Type | Default |
---|---|---|
containerRef | ref |