npm.io
0.18.0 • Published 3 years ago

@reach/portal

Licence
MIT
Version
0.18.0
Deps
1
Size
20 kB
Vulns
0
Weekly
0
Stars
6.0K

@reach/portal

Stable release MIT license

Docs | Source

Creates and appends a DOM node to the end of document.body and renders a React tree into it. Useful for rendering a natural React element hierarchy with a different DOM hierarchy to prevent parent styles from clipping or hiding content (for popovers, dropdowns, and modals).

import { Portal } from "@reach/portal";

function Example() {
	return (
		<Portal>
			<div>Stuff goes here</div>
		</Portal>
	);
}