# react-click-outside-wrapper

> A react wrapper component to detect clicking outside it's children

Latest version **0.1.1** (published 2021-05-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-click-outside-wrapper
pnpm add react-click-outside-wrapper
yarn add react-click-outside-wrapper
bun add react-click-outside-wrapper
```

## 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.1 |
| Published | 2021-05-26 |
| First published | 2021-05-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | guyariely |
| Maintainers | guyariely |
| Keywords | react, component |

## Links

- npm: https://www.npmjs.com/package/react-click-outside-wrapper
- Repository: https://github.com/guyariely/react-click-outside-wrapper
- Issues: https://github.com/guyariely/react-click-outside-wrapper/issues
- npm.io page: https://npm.io/package/react-click-outside-wrapper

## 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.1 (latest) — 2021-05-26
- 0.1.0 — 2021-05-26

## README

# react-click-outside-wrapper

A react wrapper component to detect and trigger a callback once clicked outside it's children.

## Demo

<https://react-click-outside-wrapper.netlify.app/>

## Install

Using [npm](http://npmjs.org):

```
npm i react-click-outside-wrapper
```

## Usage

Import with ES6 modules:

```js
import ClickOutsideWrapper from "react-click-outside-wrapper";
```

Example usage:

```js
function App() {
  return (
    <div className="app">
      <ClickOutsideWrapper onClickOutside={() => alert("You clicked outside!")}>
        <div className="item">
          <p>Click outside me!</p>
        </div>
      </ClickOutsideWrapper>
    </div>
  );
}
```

## Props

| Name           |   Value    |                                             Description |
| -------------- | :--------: | ------------------------------------------------------: |
| onClickOutside | `function` | Callback triggered on every click outside the component |

# License

MIT

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