A progress bar for scroll, support SSR.
npm install scroll-progress-bar
yarn add scroll-progress-bar
import progressBar from 'scroll-progress-bar';
import "scroll-progress-bar/style.css";
// show scroll progress bar
progressBar.show();
// hide scroll progress bar
progressBar.hide();
// set scroll progress bar configuration
progressBar.setConfig({
debounce: true,
})
configuration
export interface ScrollProgressConfig {
// element id
id?: string
// element scroll offset
offset?: number
// scroll debounce
debounce?: boolean
}