useWindowScroll*

React sensor hook that re-renders on window scroll.

hooks
Description of the SVG image Loading...

Variants

with useHooks

Description of the SVG image Loading...

The useWindowScroll hook is useful for tracking and manipulating the scroll position of a web page within a React component. It allows you to easily access the current scroll coordinates (x and y) through the “state” object returned by the hook. Additionally, the hook provides a “scrollTo” function that can be used to programmatically scroll to a specific position on the page. This hook is helpful when building components that require dynamic behavior based on the scroll position, such as lazy-loading content, infinite scrolling, or implementing smooth scrolling animations.

Installation

Run the following command:

npx ever-ui-clx@0.2.1 add demo-use-window-scroll
# └──> Hook coming soon.

Usage