1.0.2 • Published 4 years ago

vue3-shimmer v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Vue 3 Shimmer

A vue 3 library that provides an easy way to add a shimmer effect to any view in your vue.js app. It is useful as an unobtrusive loading indicator just like facebook cards.

Installation

npm install vue3-shimmer

Usage

Register the shimmer plugin

Register the plugin globally in your app

import { createApp } from 'vue';
import App from './App.vue';
import Shimmer from 'vue3-shimmer';

const app = createApp(App);
app.use(Shimmer);

app.mount('#app');

or add locally in your Vue component

import { CardShimmer, ParagraphShimmer, FreeStyleShimmer } from 'shimmer'

export default {
  components: {
     CardShimmer,
     ParagraphShimmer,
     FreeStyleShimmer,
  },
}

Card Shimmer

<card-shimmer :is-loading="true" />

Paragraph Shimmer

<paragraph-shimmer :is-loading="true" :lines="4" :random-size="true" />

Free Style Shimmer

<free-style-shimmer
  :is-loading="true"
  height="100px"
  width="100px"
  border-radius="50px"
  color="#bdbdbd"
/>

Props

Card Shimmer

PropertyTypevaluesdescriptiondefault
is-loadingBooleantrue falseShimmer is visible only if passed truetrue

Paragraph Shimmer

PropertyTypevaluesdescriptiondefault
is-loadingBooleantrue falseShimmer is visible only if passed truetrue
linesNumberany numberDenotes number of lines in paragraph3
random-sizeBooleantrue falseThe width of line is always random if passed true else width is 100%true

Free Style Shimmer

PropertyTypevaluesdescriptiondefault
is-loadingBooleantrue falseShimmer is visible only if passed truetrue
widthString10px 1.5rem 80%Width of your shimmer component
heightString10px 1.5rem 80%Height of your shimmer component
border-radiusString10px 1.5rem 80%Border radius of your shimmer component5px
colorString#fbfbfb rgb(211,211,211)Background color of your shimmer componentrgb(211,211,211)

License

MIT License

Copyright (c) 2021 Prafful Lachhwani

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.