# p14-modal-component-library

> React custom component - modal - center screen pop up

Latest version **0.1.7** (published 2022-11-09) · 0 weekly downloads

## Install

```sh
npm install p14-modal-component-library
pnpm add p14-modal-component-library
yarn add p14-modal-component-library
bun add p14-modal-component-library
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2022-11-09 |
| First published | 2022-11-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Yoh2L |
| Maintainers | yoh2l |

## Links

- npm: https://www.npmjs.com/package/p14-modal-component-library
- Repository: https://github.com/Yoh2L/modal-component
- Homepage: https://github.com/Yoh2L/modal-component#readme
- Issues: https://github.com/Yoh2L/modal-component/issues
- npm.io page: https://npm.io/package/p14-modal-component-library

## Dependencies (5)

- [web-vitals](https://npm.io/package/web-vitals.md) ^2.1.4
- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.12.1
- [@testing-library/react](https://npm.io/package/@testing-library/react.md) ^13.4.0
- [@testing-library/jest-dom](https://npm.io/package/@testing-library/jest-dom.md) ^5.16.5
- [@testing-library/user-event](https://npm.io/package/@testing-library/user-event.md) ^13.5.0

## Recent versions

- 0.1.7 (latest) — 2022-11-09
- 0.1.6 — 2022-11-09
- 0.1.5 — 2022-11-08
- 0.1.4 — 2022-11-08
- 0.1.3 — 2022-11-07
- 0.1.2 — 2022-11-07
- 0.1.1 — 2022-11-07

## README

# Modal component

A simple and reusable Modal component for React.

This component allow you to render a modal with a message in the center of your screen.

![Example](./src/assets/modal-example.png)

# Installation

The package can be installed via npm :

```
npm i p14-modal-component-library
```

# Configuration

The component needs two props :

- {message} : write here the message you want to display in the modal.
- {onClose} : handler to close the modal.
  You will have to add a handle closing function in your file.

  Example :

### - JS

```js
const [isModalVisible, setIsModalVisible] = useState(false);

const handleSave = (e) => {
	e.preventDefault();
	setIsModalVisible(true);
};

const handleClosing = (e) => {
	setIsModalVisible(false);
};
```

### - JSX

```js
{
	isModalVisible && (
		<Modal message={"Employee Created !"} onClose={handleClosing} />
	);
}
```

# Compatibility

This component has been developped with the current latest version of React (v18.2.0).

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