1.0.5 • Published 5 years ago

ngx-shimmering-loader v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

ngx-shimmering-loader

A component that provides shimmering loading placeholder like facebook.

sample

Installation

Install ngx-shimmering-loader via NPM, using the command below:

NPM

npm install --save ngx-shimmering-loader   

Getting started

Import the NgxShimmeringLoaderModule in your root application module AppModule or any other module you need to use the component:

 import { BrowserModule } from  '@angular/platform-browser';   
 import { NgModule } from  '@angular/core';      
 import {CommonModule} from '@angular/common';  
 import { AppComponent } from './app.component'; 
 import {NgxShimmeringLoaderModule} from 'ngx-shimmering-loader';      
 @NgModule({      
  declarations: [      
   AppComponent  
 ],  
  imports: [      
   BrowserModule,  
   CommonModule,   // Import NgxShimmeringLoaderModule   
   NgxShimmeringLoaderModule   
  ],    
  providers: [],      
bootstrap: [AppComponent] }) 
export class AppModule { }      

Using it in a component

After importing the NgxShimmeringLoaderModule, you can use the NgxShimmeringLoaderComponent component as below:

<ngx-shimmering-loader  
 [style]="style" [elemCount]="3" [isVisible]="!list">
 </ngx-shimmering-loader>  

The style input parameter should be used to set the width and height css properties.

Input Parameters

AttributeTypeRequiredDefaultDescription
isVisiblebooleanrequriedIf true, the placeholder will be visible.
elemCountnumberoptional1Number of placeholders that needs to be displayed.
styleobjectoptional{'width':'200px','height': '300px','margin': '10px' }An object suitable for the ngStyle directive that is applied on the placeholder. This should be used to set the width and height css properties.

|

License

This project is licensed under the MIT License.