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.
npm install vue-spinnerVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing and using the PulseLoader component in a Vue 3 setup script, managing its loading state and custom props.
For Vue 1.x projects, use `vue-spinner@1.0.4`. For Vue 3.x projects, ensure your Vue version is 3.5.0 or higher. Migrate your component usage to the Vue 3 Composition API where applicable.
Always consult the 'Props' section in the documentation or the component's TypeScript definitions to determine the correct sizing props for each spinner component.
If experiencing unexpected styling, inspect the elements to check for conflicting CSS rules. Use more specific CSS selectors or consider CSS Modules/scoped styles in your own components to avoid global clashes.
Ensure you either use a named import like `import { PulseLoader } from 'vue-spinner'` and list it in `components: { PulseLoader }`, or globally register it with `app.component('PulseLoader', PulseLoader)`.When importing individual components like `import PulseLoader from 'vue-spinner/src/PulseLoader.vue'`, ensure your build setup (Vite, Webpack) is correctly configured to process `.vue` Single File Components. For most cases, `import { PulseLoader } from 'vue-spinner'` is preferred as it imports the pre-compiled component.