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
#29d
The initial position for the top loader in percentage, 0.08 is 8%.
number
0.08
The increment delay speed in milliseconds.
number
200
The height for the top loader in pixel.
number
3
Auto increamenting behaviour for the top loader.
boolean
true
To show spinner or not.
boolean
true
Animation settings using easing (a CSS easing string).
string
ease
Animation speed in ms for the top loader.
number
200
Shadow for the top loader. You can disable it by setting it to false
.
string | false
0 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.
number
1600
This library is a port of Next.js top loader. A huge thanks to the creators and contributors of nextjs-toploader and nprogress.