Skip to content

SkLoading

Vue component for a loading animation.

Example Usage

Example

vue
<script setup>
import { ref } from 'vue';

const loading = ref(true);
const loadingType = ref('fancy');

function swapLoading() {
  if (loadingType.value === 'fancy') loadingType.value = 'base';
  else loadingType.value = 'fancy';
}
</script>

<template>
  <SkIcon
    name="close-circle"
    :active="true"
    fill="orange"
    style="z-index: 1000"
    @click="loading = !loading"
  />
  <SkIcon
    name="swap"
    :active="true"
    fill="orange"
    style="z-index: 1000; top: 20px"
    @click="swapLoading"
  />

  <SkLoader :loading="loading" :loader-type="loadingType" class="!z-10" @click="loading = false" />
</template>

<style lang="scss"></style>

Properties

NameTypeDefaultDescription
loadingBooleanfalseToggles the loading animation visibility
loader-typeString'fancy'Sets the loading animation type

Loader Types

NameDescription
fancyA bookshelf-themed loading animation with a book that moves left and right
baseA simple loading animation with a rotating circle