Skip to content

Loader

A simple vue loader. Perfect for all your loader scenarios.

Demo ​

Pulse

Dots

Inline

Skeleton - Line

Skeleton - Line (custom width + color)

Skeleton - Circle

Skeleton - Square

Skeleton - Card preview


Install ​

bash
npm i @vuesimple/vs-loader

Usage ​

html
<template>
  <vs-loader variant="pulse"></vs-loader>
</template>

<script>
  import VsLoader from '@vuesimple/vs-loader';

  export default {
    components: {
      VsLoader,
    },
  };
</script>

CDN ​

html
<script src="https://cdn.jsdelivr.net/npm/@vuesimple/vs-loader@3.1.8/dist/index.min.js"></script>
javascript
// Main/Entry file
app.use(VsLoader.plugin);
html
<template>
  <vs-loader variant="pulse"></vs-loader>
</template>

Props ​

NameTypeDefaultDescription
variantStringpulseVariants: pulse, dots, inline, skeleton.
colorString#1f73b7Loader color.
sizeNumber10Loader size.
centerBoolean-Center aligns the loader wrt the parent div.

Skeleton props (variant="skeleton") ​

NameTypeDefaultDescription
typeStringlineShape of the skeleton item. Options: line, square, circle.
countNumber|String1Number of skeleton items to render.
sizeNumber|String-Override size in px or any CSS value. Sets height for line, width+height for square/circle.
widthString-Override width for line type (e.g. 60%, 200px).
colorString-Base skeleton color. Defaults to #e9e9e9. Also accepts CSS variable.
centerBoolean-Center aligns the skeleton items.

Skeleton CSS variables ​

VariableDefaultDescription
--vs-skeleton-color#e9e9e9Base background color.
--vs-skeleton-shimmerrgba(255, 255, 255, 0.6)Shimmer highlight color.

🦴 Skeleton Examples ​

Line (default)

html
<vs-loader variant="skeleton" type="line" :count="3" />

Circle

html
<vs-loader variant="skeleton" type="circle" :count="3" size="48" />

Square

html
<vs-loader variant="skeleton" type="square" size="100" />

Card preview layout

html
<div style="display: flex; gap: 16px; align-items: flex-start">
  <vs-loader variant="skeleton" type="circle" size="48" />
  <div style="flex: 1; display: flex; flex-direction: column; gap: 8px">
    <vs-loader variant="skeleton" type="line" width="50%" size="14" />
    <vs-loader variant="skeleton" type="line" width="80%" size="14" />
    <vs-loader variant="skeleton" type="line" width="65%" size="14" />
  </div>
</div>

Custom color via CSS variable

html
<vs-loader variant="skeleton" type="line" :count="3" style="--vs-skeleton-shimmer: rgba(255,255,255,0.9)" />