16.0.0 • Published 8 months ago

ngx-skeleton v16.0.0

Weekly downloads
254
License
MIT
Repository
github
Last release
8 months ago

ngx-skeleton

Angular placeholder preview component before the content is loaded.

npm NPM npm bundle size

Environment Support

  • Angular 6+
  • Server-side Rendering

Compatibility

Versions compatibility list:

ngx-skeletonAngular
16.x.x16.x.x
15.x.x15.x.x
14.x.x14.x.x
13.x.x13.x.x
12.x.x12.x.x
11.x.x11.x.x
1.x.x6.xx - 10.x.x

Installation

npm i ngx-skeleton

OR

yarn install ngx-skeleton

Demo

Demo page

Usage

Import NgxSkeletonModule into the current module's imports:

import { NgxSkeletonModule } from 'ngx-skeleton';

imports: [
  // ...
  NgxSkeletonModule,
],

You can also import NgxSkeletonComponent as standalone component:

import { NgxSkeletonComponent } from 'ngx-skeleton';

@Component({
  standalone: true,
  imports: [NgxSkeletonComponent],
  // ...
})
export class MyComponent {}

Use in your components (this is code example from demo page):

<ng-container *ngIf="!isLoading; else loadingContent">
  <h5>{{ movie.title }}</h5>
  <h6 class="text-black-50">{{ movie.date }}</h6>
</ng-container>
<ng-template #loadingContent>
  <ngx-skeleton height="24px" margin="0 0 8px 0" width="50%"></ngx-skeleton>
  <ngx-skeleton height="19px" margin="0 0 8px 0"></ngx-skeleton>
</ng-template>

API

Inputs

InputTypeDefault
animatebooleantrue
backgroundColorstring'rgba(0, 0, 0, 0.08)'
borderRadiusnumber | string0
heightnumber | string'100%'
marginnumber | string0
variant'rect' or 'circle''rect'
widthnumber | string'100%'

License

MIT

16.0.0

8 months ago

15.0.0

1 year ago

0.0.0

2 years ago

14.0.0

2 years ago

13.0.0

2 years ago

12.0.0

3 years ago

12.0.1

3 years ago

11.0.0

3 years ago

1.0.0

5 years ago