Description
react-modal is an accessible modal dialog component for React, maintained in the reactjs organization on GitHub. It renders a dialog above the page so you can show your own content in a popup. You can install it from npm or yarn. For a React app that is loaded from CDN scripts rather than a bundler, the README gives a way to add it with a script tag placed after the React scripts. The primary documentation is a reference book that describes the API and shows how each part is used. The repository also has an examples directory that you can run on a local development server with npm start or yarn run start. Hosted CodePen demos show a minimal dialog, setAppElement, onRequestClose, shouldCloseOnOverlayClick, inline styles, CSS class styling, and customizing the default styles. It suits React developers who need a dialog with focusable content inside it and want control over how it looks.…
Highlights
- Accessible modal dialog for React
- Install with npm or yarn
- Usable from a React app loaded via CDN
- Callbacks such as onRequestClose
- Style with inline styles or CSS classes
- Runnable examples and CodePen demos
Ratings & Reviews
No ratings yet
Be the first to rate react-modal.
People also visit

react-native-use-modal-hooks
React hooks for displaying a modal window in React Native
react-modal FAQ
What is react-modal?
It is a React component that shows content in a modal dialog on top of the page. The project describes it as an accessible modal dialog component for React.
How do I install it?
Run npm install --save react-modal, or yarn add react-modal.
Can I use it without a bundler?
Yes. The README describes adding it to a React app that loads React from CDN scripts, using a script tag placed after the React scripts.
Where can I see examples?
The repository has an examples directory you can run with npm start or yarn run start. CodePen demos cover a minimal dialog, setAppElement, onRequestClose, shouldCloseOnOverlayClick, inline styles and CSS classes.
Where is the documentation?
The main documentation is a reference book that describes the API and gives examples of its use, linked from the project's README.
What are the best react-modal alternatives?
Popular alternatives to react-modal include react-aria-modal, react-bootstrap-modal and react-native-use-modal-hooks. See all react-modal alternatives




















