# @jsmine/react-popup-utils

> 'utility functions for popup'

Latest version **2.0.5** (published 2021-07-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install @jsmine/react-popup-utils
pnpm add @jsmine/react-popup-utils
yarn add @jsmine/react-popup-utils
bun add @jsmine/react-popup-utils
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.5 |
| Published | 2021-07-02 |
| First published | 2020-09-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | 'manish |
| Maintainers | manish93 |
| Keywords | react, popup, wrapper, react-component |

## Links

- npm: https://www.npmjs.com/package/@jsmine/react-popup-utils
- Repository: https://github.com/jsmine-dot/react-popup-utils
- Homepage: https://github.com/jsmine-dot/react-popup-utils#readme
- Issues: https://github.com/jsmine-dot/react-popup-utils/issues
- npm.io page: https://npm.io/package/@jsmine/react-popup-utils

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

- 2.0.5 (latest) — 2021-07-02
- 2.0.4 — 2021-04-11
- 2.0.3 — 2021-04-11
- 2.0.2 — 2021-04-11
- 2.0.1 — 2021-04-11
- 1.0.2 — 2020-09-06
- 1.0.1 — 2020-09-05
- 1.0.0 — 2020-09-05

## README

# react-popup-utils
A react component which can be used as wrapper for any popup. 
This component easily detects mouse clicks done on its wrapped element or out side and triggers the call back.
It also triggers callback on `esc` key and on `timeout`.

[Example](https://codesandbox.io/s/ecstatic-kirch-pkw8e)

## Getting Started
install the react-popup-utils via npm:
```
npm i @jsmine/react-popup-utils
```

import it in your file:
```
import PopupUtils from '@jsmine/react-popup-utils
```

wrap your popup:
```javascript
<PopupUtils closePopup={()=>'your popup close handler'}>
    <div>popup</div>
</PopupUtils>
```

## Props
| props | type | default value | description|
| --------------- | --------------- | --------------- | --------------- |
| closePopup | function | none | function passed in this prop will be called on getting clicked or on other callback triggers |
| closeOnSelfClick | bool | false | if set true, popup close handler will trigger even on getting clicked on wrapped element |
| closeOnClickOutSide | bool | true | if set false, popup close handler will not trigger |
| closeOnEscape | bool | true | if set true, popup close handler will trigger on clicking `esc` key |
| setTimeout | bool | false | if set true, popup close handler will trigger after specified time |
| timeoutTime | number | 1500 milliseconds | it takes timeout time in millisecond |

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