# react-observe-visibility

> Observe React component visibility in the viewport or visibility relative to an ancestor

Latest version **1.0.0** (published 2021-10-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-observe-visibility
pnpm add react-observe-visibility
yarn add react-observe-visibility
bun add react-observe-visibility
```

## 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 | 1.0.0 |
| Published | 2021-10-31 |
| First published | 2021-10-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tahmid Shakil |
| Maintainers | atshakil |
| Keywords | react, observe, observer, observe-visibility, observe-component-visibility |

## Links

- npm: https://www.npmjs.com/package/react-observe-visibility
- Repository: https://github.com/atshakil/observe-visibility
- Homepage: https://github.com/atshakil/observe-visibility#readme
- Issues: https://github.com/atshakil/observe-visibility/issues
- npm.io page: https://npm.io/package/react-observe-visibility

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^17.0.2
- [classnames](https://npm.io/package/classnames.md) ^2.3.1

## 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.0 (latest) — 2021-10-31

## README

# Observe Visibility

## Summary

Observe React component visibility in the viewport or visibility relative to an ancestor.

## Installation

```sh
$ npm install observe-visibility
$ yarn add observe-visibility
```

## Usage

Example:

```
<ObserveVisibility>
  {({ isVisible }) => {
    isVisible && doSomething();
    return <Placeholder />;
  }}
</ObserveVisibility>
```

## Contributing

If you are interested in contributing, please [submit a pull request](https://help.github.com/articles/about-pull-requests/).

## License

[MIT](http://opensource.org/licenses/MIT)

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