# arnaudballand-react-modal-library

> A simple and customizable react modal component

Latest version **1.0.2** (published 2022-12-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install arnaudballand-react-modal-library
pnpm add arnaudballand-react-modal-library
yarn add arnaudballand-react-modal-library
bun add arnaudballand-react-modal-library
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-12-15 |
| First published | 2022-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 21.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Arnaud Balland |
| Maintainers | arnaudballand |
| Keywords | react, modal, library |

## Links

- npm: https://www.npmjs.com/package/arnaudballand-react-modal-library
- Homepage: https://github.com/BallandArnaud/react-modal-library#readme
- Issues: https://github.com/BallandArnaud/react-modal-library/issues
- npm.io page: https://npm.io/package/arnaudballand-react-modal-library

## 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

- 1.0.2 (latest) — 2022-12-15
- 1.0.1 — 2022-12-13
- 1.0.0 — 2022-12-13

## README

# arnaudballand-react-modal-library

arnaudballand-react-modal-library is a simple and reusable modal component for React

## Installation

The package can be installed via [npm](https://www.npmjs.com)

```bash
npm i arnaudballand-react-modal-library
```

## Configuration

#### 1. import

When you need the modal component, you have to import the component in your file

```js
import { Modal } from 'arnaudballand-react-modal-library'
```

#### 2. Required props

To run this modal, only two props are required

```js
isModalOpen, // Boolean
setIsModalOpen, // Function to update isModalOpen
```

## Example

Basic example

```js
import React, { useState } from 'react'
import { Modal } from 'arnaudballand-react-modal-library'

const Example = () => {
  const [isModalOpen, setIsModalOpen] = useState(false)
  return (
    <>
      <button onClick={() => setIsModalOpen(true)}>Open modal</button>
      <Modal isModalOpen={isModalOpen} setIsModalOpen={setIsModalOpen}>
        <h2>Modal test</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit...</p>
      </Modal>
    </>
  )
}
```

Add className to customize modal with css

```js
<Modal
  className="customModal"
  isModalOpen={isModalOpen}
  setIsModalOpen={setIsModalOpen}
>
  ...
</Modal>
```

```css
.customModal .reactModalLib__container {
  background-color: #c1121f;
}
```

## License

Licensed under [MIT](https://choosealicense.com/licenses/mit/) license.

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