# use-position-y-offset

> React Hook that triggers on window scroll and return y offset

Latest version **0.1.7** (published 2022-10-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install use-position-y-offset
pnpm add use-position-y-offset
yarn add use-position-y-offset
bun add use-position-y-offset
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2022-10-26 |
| First published | 2022-10-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | OleksiiCherevan |
| Maintainers | oleksii_cherevan |
| Keywords | react, hooks, screen position |

## Links

- npm: https://www.npmjs.com/package/use-position-y-offset
- npm.io page: https://npm.io/package/use-position-y-offset

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^18.2.0
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.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.7 (latest) — 2022-10-26
- 0.1.6 — 2022-10-26
- 0.1.5 — 2022-10-26
- 0.1.4 — 2022-10-26
- 0.1.3 — 2022-10-26
- 0.1.2 — 2022-10-26
- 0.1.1 — 2022-10-26
- 0.1.0 — 2022-10-26

## README

<h1>usePositionYOffset</h1>
React Hook that triggers on window scroll and return Y offset

<br/>
<br/>

```
npm install use-position-y-offset 
```

or 

```
yarn add use-position-y-offset 
```
<br/>
<br/>
<b>Example</b>
<br/>
In your React component:
<br/>

```
import usePositionYOffset from "position-y-offset"

function PositionInfo() {
  const postitionYOffset = usePositionYOffset()

  return <div>position = ({ postitionYOffset })</div>
}
```

<b>Settings:</b>
<br/>
debounceTime - number (default 200ms)

```
...
const postitionYOffset = usePositionYOffset({debounceTime:200})
```
callback - function (default undefined)

```
...
const handlePositionChange = (positionYOffset) => {
    console.log(positionYOffset);
}

usePositionYOffset({function: handlePositionChange})
```

## Word from author

All the best :3

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