# react-responsive-modal

> A simple responsive and accessible react modal

Latest version **7.2.0** (published 2026-06-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-responsive-modal
pnpm add react-responsive-modal
yarn add react-responsive-modal
bun add react-responsive-modal
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 7.2.0 |
| Published | 2026-06-13 |
| First published | 2016-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 104.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 612 |
| Author | Léo Pradel |
| Maintainers | leopradel |
| Keywords | flex, mobile, modal, react, responsive |

## Links

- npm: https://www.npmjs.com/package/react-responsive-modal
- Repository: https://github.com/pradel/react-responsive-modal
- Homepage: https://react-responsive-modal.leopradel.com/
- Issues: https://github.com/pradel/react-responsive-modal/issues
- Funding: https://github.com/sponsors/pradel
- npm.io page: https://npm.io/package/react-responsive-modal

## Dependencies (3)

- [classnames](https://npm.io/package/classnames.md) ^2.3.1
- [body-scroll-lock](https://npm.io/package/body-scroll-lock.md) ^3.1.5
- [@bedrock-layout/use-forwarded-ref](https://npm.io/package/@bedrock-layout/use-forwarded-ref.md) ^2.0.17

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 7.2.0 (latest) — 2026-06-13
- 7.1.0 — 2025-10-01
- 7.0.0 — 2025-07-13
- 6.4.2 — 2023-06-19
- 6.4.1 — 2022-12-12
- 6.3.2 — 2022-12-12
- 6.2.0 — 2021-12-14
- 6.1.0 — 2021-06-01
- 6.0.1 — 2021-01-08
- 6.0.0 — 2020-11-15
- 5.2.6 — 2020-11-07
- 5.2.5 — 2020-11-07
- 5.2.1 — 2020-11-02
- 5.2.0 — 2020-10-28
- 5.1.1 — 2020-09-23
- … 47 more at https://npm.io/package/react-responsive-modal/versions

## README

# react-responsive-modal

[![npm version](https://img.shields.io/npm/v/react-responsive-modal.svg)](https://www.npmjs.com/package/react-responsive-modal)
[![npm downloads per month](https://img.shields.io/npm/dm/react-responsive-modal.svg)](https://www.npmjs.com/package/react-responsive-modal)
[![codecov](https://img.shields.io/codecov/c/github/pradel/react-responsive-modal/master.svg)](https://codecov.io/gh/pradel/react-responsive-modal)

A simple responsive and accessible react modal.

- Focus trap inside the modal.
- Centered modals.
- Scrolling modals.
- Multiple modals.
- Accessible modals.
- Easily customizable via props.
- Typescript support
- [Small bundle size](https://bundlephobia.com/result?p=react-responsive-modal)

## Documentation

- [Getting started](https://react-responsive-modal.leopradel.com/)
  - [Installation](https://react-responsive-modal.leopradel.com/#installation)
  - [Usage](https://react-responsive-modal.leopradel.com/#usage)
  - [Props](https://react-responsive-modal.leopradel.com/#props)
  - [Licence](https://react-responsive-modal.leopradel.com/#license)

## Installation

With npm: `npm install react-responsive-modal --save`

Or with yarn: `yarn add react-responsive-modal`

## Usage

[![Edit react-responsive-modal](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/9jxp669j2o)

```javascript
import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import 'react-responsive-modal/styles.css';
import { Modal } from 'react-responsive-modal';

const App = () => {
  const [open, setOpen] = useState(false);

  const onOpenModal = () => setOpen(true);
  const onCloseModal = () => setOpen(false);

  return (
    <div>
      <button onClick={onOpenModal}>Open modal</button>
      <Modal open={open} onClose={onCloseModal} center>
        <h2>Simple centered modal</h2>
      </Modal>
    </div>
  );
};

ReactDOM.render(<App />, document.getElementById('app'));
```

## Props

Check the documentation: https://react-responsive-modal.leopradel.com/#props.

## License

MIT © [Léo Pradel](https://www.leopradel.com/)

---
_Source: https://npm.io/package/react-responsive-modal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
