Angular 17+ standalone skeleton loader component & directive with SCSS animations (shimmer, pulse, wave). Lightweight, themeable, and designed for instant loading states.
- ⚡ Standalone Angular component — drop it anywhere, no NgModule needed
- 🎨 SCSS theming with CSS variables
- 🔄 Animations: shimmer, pulse, wave
- 🧩 Component + structural directive (
*ngxsmkSkeleton
) - 📱 Responsive and mobile-friendly
- ♿ Accessible (role="presentation")
- ✅ SSR-safe (no direct DOM hacks)
npm install ngxsmk-skeleton-loader
Requires Angular 17+.
<ngxsmk-skeleton type="text" width="80%"></ngxsmk-skeleton>
<ngxsmk-skeleton type="circle" size="56"></ngxsmk-skeleton>
<ngxsmk-skeleton type="rect" width="100%" [height]="180"></ngxsmk-skeleton>
<ng-container *ngxsmkSkeleton="loading; type: 'text'; width: '70%'">
<p>Loaded content appears here</p>
</ng-container>
Input | Type | Default | Description |
---|---|---|---|
type |
'text' | 'rect' | 'circle' | ... |
text |
Shape preset |
width |
string | number |
100% |
Width (string or px number) |
height |
string | number |
1rem |
Height |
size |
string | number |
– | Shortcut for width+height |
radius |
string | number |
auto | Border radius |
animate |
'shimmer' | 'pulse' | 'wave' | 'none' |
shimmer |
Animation style |
Override CSS variables globally or per element:
ngxsmk-skeleton {
--ngx-skel-base: #e5e7eb;
--ngx-skel-highlight: #ffffffb3;
}
ng build ngxsmk-skeleton-loader
Output in dist/ngxsmk-skeleton-loader/
.
cd dist/ngxsmk-skeleton-loader
npm publish --access public
Use the provided demo app:
ng serve ngxsmk-skeleton-demo
Then open http://localhost:4200.
If this saved you time, please ⭐ star the repo and share with fellow Angular devs!