Description
react-portal is a React component that moves its children out of the normal component tree and renders them somewhere else, by default in document.body. It is aimed at modals, lightboxes, loading bars and similar overlays, which often break when they sit inside a parent with overflow, transform or positioning rules. The component creates a new top-level React tree and injects its children into it, which is what makes positioning and styling reliable. The README says it uses React's official portal API from version 16 and has a fallback for React 15. You can choose the target element rather than always using the body. A separate note points to version 3 documentation for newer usage. It is a small library for developers who need overlays that stay visually correct wherever they are used in the app. The project is hosted on GitHub under tajo.…
Highlights
- Renders children outside the normal tree, by default in document.body
- Uses React's portal API from version 16
- Fallback for React 15
- Target element can be chosen
Ratings & Reviews
No ratings yet
Be the first to rate react-portal.
People also visit

react-relative-portal
React component for place dropdowns outside overflow: hidden; elements
react-portal FAQ
What is react-portal for?
Modals, lightboxes, loading bars and other overlays that need to render outside their parent.
Where does it render by default?
Into document.body, according to the README.
Which React versions does it support?
It uses React 16's portal API, with a fallback for React 15.
Can I change the target?
Yes. The README says you can target an element other than document.body.
Is it free?
The listing shows the library as free.
Where is the source?
On GitHub under tajo/react-portal.
What are the best react-portal alternatives?
Popular alternatives to react-portal include @rc-component/portal, react-relative-portal and react-modal. See all react-portal alternatives




















