Skip to content

useWindowScroll

Hook that manages the window scroll position

sensors
low
test coverage
Last changed: last month

Installation

Library
CLI
Manual
typescript
import { useWindowScroll } from '@siberiacancode/reactuse';

Usage

typescript
const { value, scrollTo } = useWindowScroll();

Demo

Api

Returns

UseWindowScrollReturn

Type declaration

typescript
export interface ScrollPosition {
  x: number;
  y: number;
}

Source

SourceDemo

Contributors

D
debabin
debabin

Released under the MIT License.