Content Placeholders for Vue 2

0.2.1 · abandoned · verified Sun Apr 19

This package, `vue-content-placeholders`, offers Vue 2 components for generating animated content placeholders, often referred to as "skeleton UI," similar to those seen on platforms like Facebook. It aims to improve user experience during data fetching by providing visual feedback and reducing perceived loading times. The current stable version, 0.2.1, was released in November 2017 and targets Vue 2 applications. Due to its age and lack of updates, it is considered abandoned and not compatible with Vue 3 without significant modifications or using a separate, Vue 3-specific fork. Its primary differentiation was providing a straightforward, component-based API for common placeholder patterns and being one of the early solutions for this UX pattern in the Vue 2 ecosystem.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates installing the `vue-content-placeholders` plugin globally and then using its components in a Vue 2 application to display animated content placeholders while data is simulated to be loading.

import Vue from 'vue';
import VueContentPlaceholders from 'vue-content-placeholders';

Vue.use(VueContentPlaceholders);

new Vue({
  el: '#app',
  data: () => ({ loading: true }),
  mounted() {
    setTimeout(() => {
      this.loading = false;
    }, 2000);
  },
  template: `
    <div id="app">
      <div v-if="loading">
        <content-placeholders :rounded="true">
          <content-placeholders-img />
          <content-placeholders-heading />
          <content-placeholders-text :lines="3" />
        </content-placeholders>
      </div>
      <div v-else>
        <h1>Content Loaded!</h1>
        <p>This is the actual content displayed after loading.</p>
      </div>
    </div>
  `
});

view raw JSON →