2.3.0 • Published 3 years ago

@wbe/use-is-in-viewport v2.3.0

Weekly downloads
269
License
MIT
Repository
github
Last release
3 years ago

@wbe/use-is-in-viewport

This React hook allow to check if a specific ref element is visible in viewport.

npm.io npm.io npm.io npm.io npm.io

Installation

$ npm install -s @wbe/use-is-in-viewport

How to use

import { useIsInViewport } from "@wbe/use-is-in-viewport;";

// Get element ref
const ref = useRef(null);

// Check if is in viewport (hook return boolean)
const isInViewport = useIsInViewport(ref);

return <div ref={ref} />;

Parameters

paramstypedescriptiondefault value
pRefMutableRefObjectelement ref/
pToogleVisibilitybooleanRepeat the check visibility even if ref element visibility is already passed to truefalse
pOffsetnumberDefine a positive or negative offset to the ref element0

Returned

Hook return a boolean.

2.3.0

3 years ago

2.2.0-alpha.0

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

2.0.0-alpha.11

3 years ago

2.0.0-alpha.10

3 years ago

2.0.0-alpha.7

3 years ago

2.0.0-alpha.6

3 years ago

2.0.0-alpha.3

3 years ago

2.0.0-alpha.2

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.2

4 years ago

1.4.2-alpha.0

4 years ago

1.4.1

4 years ago

1.4.0-alpha.0

4 years ago

1.4.0

4 years ago

1.3.1-alpha.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0-alpha.0

4 years ago

1.0.0-alpha.0

4 years ago

0.0.30

4 years ago

0.0.29

4 years ago

0.0.28

4 years ago

0.0.27

4 years ago

0.0.24

4 years ago

0.0.25

4 years ago

0.0.26

4 years ago

0.0.23

4 years ago

0.0.22

4 years ago