Simple Loading Spinner for Svelte
npm install svelte-loading
<script lang='ts'>
import { showLoading } from 'svelte-loading';
showLoading()
</script>
if you want hide loading component you must call hideLoading
method.
showLoading({ duration: 2000 })
after 2 seconds loading will auto hide
showLoading({ color: '#FFF'})
import { showLoading, LoadingEnum } from 'svelte-loading';
showLoading({ type: LoadingEnum.Infinity })
App.svelte
<script lang='ts'>
import { Loading, showLoading, LoadingEnum } from 'svelte-loading';
showLoading()
</script>
...
<Loading />
export enum LoadingEnum {
Eclipes,
Infinity,
Ring,
Ripple,
Spinner
}
export type LoadingTypes = {
size?: string | number
color?: string
duration?: number
type?: LoadingEnum
}