UseGetScrollProgress
katanakit-js / useGetScrollProgress
Function: useGetScrollProgress()
Section titled “Function: useGetScrollProgress()”function useGetScrollProgress(): number;Defined in: infrastructure/viewport/viewport.service.ts:121
Returns the vertical scroll progress as a value between 0 (top) and 1 (bottom).
Returns
Section titled “Returns”number
A number in [0, 1].
Example
Section titled “Example”const progress = useGetScrollProgress();progressBar.style.width = `${progress * 100}%`;