# p14-mymodal

> Simple Modal created for HRnet.

Latest version **0.1.6** (published 2022-06-29) · 0 weekly downloads

## Install

```sh
npm install p14-mymodal
pnpm add p14-mymodal
yarn add p14-mymodal
bun add p14-mymodal
```

## 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.6 |
| Published | 2022-06-29 |
| First published | 2022-06-21 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | mimi1706 |
| Keywords | react, react-component, modal, dialog |

## Links

- npm: https://www.npmjs.com/package/p14-mymodal
- Homepage: https://github.com/Mimi1706/p14-myModal
- npm.io page: https://npm.io/package/p14-mymodal

## Dependencies (1)

- [gh-pages](https://npm.io/package/gh-pages.md) ^4.0.0

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

- 0.1.6 (latest) — 2022-06-29
- 0.1.5 — 2022-06-22
- 0.1.4 — 2022-06-22
- 0.1.3 — 2022-06-22
- 0.1.2 — 2022-06-21
- 0.1.1 — 2022-06-21

## README

# p14-mymodal
Simple Modal created for HRnet.

## Intallation
To install, you can either use [npm](https://npmjs.org/) or [yarn](https://yarnpkg.com):

```
npm install p14-mymodal
```

```
yarn add p14-mymodal
```

## How to use
After installing this library, you'll need to use the useState() hook from react:
```
import React from 'react';
import { useState } from "react";

const [modalDisplay, setModalDisplay] = useState(false);
```
By default, the modal will be hidden as represented by the **false** boolean set in `useState(false)`, to show it, you'll have to set `modalDisplay` to **true** with `setModalDisplay(true)`.

### Example

```
import React from 'react';
import { useState } from "react";
import { render } from "react-dom";
import Modal from "p14-mymodal";

const App = () => {
  const [modalDisplay, setModalDisplay] = useState(false);

  return <div style={{ width: "100%", display:"flex", justifyContent:"center"}}>
    <button onClick={() => setModalDisplay(true)}>Open Modal</button>
    <Modal action={() => setModalDisplay(false)} display={modalDisplay} message={"Your message here."}/>
  </div>
};

render(<App />, document.getElementById("root"));
```

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