# @stackmeister/react-use-intersection-observer

> @stackmeister/react-use-intersection-observer =============================================

Latest version **0.1.5** (published 2022-11-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @stackmeister/react-use-intersection-observer
pnpm add @stackmeister/react-use-intersection-observer
yarn add @stackmeister/react-use-intersection-observer
bun add @stackmeister/react-use-intersection-observer
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2022-11-09 |
| First published | 2022-11-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | torbenkoehn |

## Links

- npm: https://www.npmjs.com/package/@stackmeister/react-use-intersection-observer
- Repository: https://github.com/StackmeisterGmbH/typescript-packages
- Homepage: https://github.com/StackmeisterGmbH/typescript-packages#readme
- Issues: https://github.com/StackmeisterGmbH/typescript-packages/issues
- npm.io page: https://npm.io/package/@stackmeister/react-use-intersection-observer

## Recent versions

- 0.1.5 (latest) — 2022-11-09
- 0.1.4 — 2022-11-09
- 0.1.3 — 2022-11-09

## README

@stackmeister/react-use-intersection-observer
=============================================

A hook that wraps around the DOM IntersectionObserver.

With it you can check things like "for how many percent is this element in that element"
or "am I scrolled half over this element".

Install
=======

```bash
// Yarn
yarn add @stackmeister/react-use-intersection-observer

// NPM
npm i @stackmeister/react-use-intersection-observer
```

TypeScript typings are included (No `@types/` package needed)

Usage
=====

```tsx
import useIntersectionObserver from '@stackmeister/react-use-intersection-observer'

const App = () => {
  const { ref, entry } = useIntersectionObserver()

  // entry =
  // {
  //   boundingClientRect: DOMRect,
  //   intersectionRatio: number,
  //   intersectionRect: DOMRect,
  //   isIntersecting: boolean,
  //   rootBounds: DOMRect,
  //   time: number,
  // }

  return (
    <div ref={ref}>
      ...
    </div>
  )
}
```

---
_Source: https://npm.io/package/@stackmeister/react-use-intersection-observer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
