A SvelteKit top loading bar component made using nprogress.
Note: you might have to throttle the network speed to see the top loader 😅
https://sveltekit-top-loader.pages.dev/
Using npm:
npm install sveltekit-top-loader
In your root +layout.svelte file, import the component and render it at the top.
<script lang="ts">
import { SvelteKitTopLoader } from 'sveltekit-top-loader';
</script>
<div>
<SvelteKitTopLoader />
<slot />
</div>
Color for the top loader.
string#29dThe initial position for the top loader in percentage, 0.08 is 8%.
number0.08The increment delay speed in milliseconds.
number200The height for the top loader in pixel.
number3Auto increamenting behaviour for the top loader.
booleantrueTo show spinner or not.
booleantrueAnimation settings using easing (a CSS easing string).
stringeaseAnimation speed in ms for the top loader.
number200Shadow for the top loader. You can disable it by setting it to false.
string | false0 0 10px ${color},0 0 5px ${color}Template for the top loader.
string<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>z-index for the top loader.
number1600This library is a port of Next.js top loader. A huge thanks to the creators and contributors of nextjs-toploader and nprogress.