Vue Spinner Components

3.0.1 · active · verified Sun Apr 19

vue-spinner is a collection of 16 highly customizable loading spinner components for Vue.js applications. Currently at version 3.0.1, it specifically targets Vue 3.5+ using the Composition API, offering full TypeScript support with detailed prop types, and ships with ESM and UMD outputs for broad compatibility. The library differentiates itself by providing a variety of pre-built, production-ready spinners based on the Halogen project, covering common loading patterns with props for `loading` state, `color`, `size` (or `height`/`width`), `margin`, and `radius`. While it recently underwent a major overhaul for Vue 3 compatibility, previous versions (like 1.0.4) are available for Vue 1.x projects, establishing a clear versioning strategy tied to Vue's major releases. The project appears to have an active maintenance cadence, with recent updates adding significant test coverage via Vitest.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates importing and using the PulseLoader component in a Vue 3 setup script, managing its loading state and custom props.

import { ref } from 'vue'
import { PulseLoader } from 'vue-spinner'

const App = {
  setup() {
    const loading = ref(true)
    const color = ref('#5dc596')
    const size = ref('15px')

    // Simulate loading state change after a few seconds
    setTimeout(() => {
      loading.value = false;
    }, 3000);

    return {
      loading,
      color,
      size
    }
  },
  template: `
    <div style="display: flex; justify-content: center; align-items: center; min-height: 100px;">
      <pulse-loader :loading="loading" :color="color" :size="size"></pulse-loader>
      <p v-if="!loading" style="margin-left: 10px;">Content Loaded!</p>
    </div>
  `,
  components: { PulseLoader }
}

// In a real Vue app, you would mount this:
// import { createApp } from 'vue'
// createApp(App).mount('#app')

view raw JSON →