Skip to content
0

katanakit-js / useGetScrollPosition

Function: useGetScrollPosition() ​

ts
function useGetScrollPosition(): {
  x: number;
  y: number;
};

Defined in: src/infrastructure/viewport/viewport.service.ts:105

Returns the current scroll position as { x, y }.

Returns ​

ts
{
  x: number;
  y: number;
}

A ScrollPosition object.

x ​

ts
x: number;

y ​

ts
y: number;

Example ​

ts
const { x, y } = useGetScrollPosition();

Released under the MIT License.