vue-loaders is a JavaScript library providing Vue.js component wrappers for the popular loaders.css library, which offers a collection of animated loading indicators. The current stable version is 4.1.4. The project actively maintains support for both Vue 2 and Vue 3, with v4.0.0 introducing compatibility for Vue 3. Releases are made on an as-needed basis for features and bug fixes, indicated by recent minor version bumps and a major version increment for Vue 3 support. It differentiates itself by offering flexible integration options: developers can register all loaders globally via a plugin, import individual loader components directly, or dynamically render loaders using a single vue-loaders component with a name prop. It also ships with TypeScript types, improving developer experience in typed environments.
npm install vue-loadersVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to register all loaders globally using `Vue.use(VueLoaders)` and then utilize both the dedicated component syntax (`<vue-loaders-ball-beat>`) and the dynamic `name` prop approach (`<vue-loaders name="ball-beat">`). It also includes the necessary CSS import for styling.
For Vue 2 projects, use `npm install vue-loaders@^3` to explicitly install the latest Vue 2 compatible version. For Vue 3 projects, upgrade to v4.x.x.
Ensure `import 'vue-loaders/dist/vue-loaders.css';` is present in your application's entry point (e.g., `main.js`/`main.ts`) or properly linked in your HTML/main stylesheet.
Instead of `Vue.use(VueLoaders)`, import specific loaders like `import VueLoadersBallBeat from 'vue-loaders/dist/loaders/ball-beat';` and register them in your component's `components` option: `{ components: { VueLoadersBallBeat } }`.Use `<vue-loaders name="ball-beat" color="currentColor"></vue-loaders>` if you intend for the loader to dynamically inherit its color from its parent container's CSS `color` property.
Add `Vue.use(VueLoaders);` to your application's entry file (e.g., `main.js` or `main.ts`), or import specific loaders and register them in your component's `components` option: `{ components: { VueLoadersBallBeat } }`.Ensure `import 'vue-loaders/dist/vue-loaders.css';` is included in your main JavaScript/TypeScript file or that the CSS file is otherwise correctly loaded by your build system.