Skip to content
0

katanakit-js / useGetScrollProgress

Function: useGetScrollProgress() ​

ts
function useGetScrollProgress(): number;

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

Returns the vertical scroll progress as a value between 0 (top) and 1 (bottom).

Returns ​

number

A number in [0, 1].

Example ​

ts
const progress = useGetScrollProgress();
progressBar.style.width = `${progress * 100}%`;

Released under the MIT License.