2.3.0 • Published 4 years ago

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

Weekly downloads
269
License
MIT
Repository
github
Last release
4 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

4 years ago

2.2.0-alpha.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

2.0.0-alpha.11

4 years ago

2.0.0-alpha.10

4 years ago

2.0.0-alpha.7

4 years ago

2.0.0-alpha.6

4 years ago

2.0.0-alpha.3

4 years ago

2.0.0-alpha.2

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.2

5 years ago

1.4.2-alpha.0

5 years ago

1.4.1

5 years ago

1.4.0-alpha.0

5 years ago

1.4.0

5 years ago

1.3.1-alpha.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0-alpha.0

5 years ago

1.0.0-alpha.0

5 years ago

0.0.30

5 years ago

0.0.29

5 years ago

0.0.28

5 years ago

0.0.27

5 years ago

0.0.24

5 years ago

0.0.25

5 years ago

0.0.26

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago