Gathering detailed insights and metrics for ngx-spinner
Gathering detailed insights and metrics for ngx-spinner
Gathering detailed insights and metrics for ngx-spinner
Gathering detailed insights and metrics for ngx-spinner
ngx-loading
A customisable loading spinner for Angular applications.
ngx-number-spinner
README.md
@traent/ngx-spinner
<h1 align="center"> @traent/ngx-spinner </h1>
@developer-partners/ngx-loading-spinner
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.6.
npm install ngx-spinner
Typescript
Module System
Node Version
NPM Version
CSS (83.54%)
TypeScript (12.81%)
HTML (2.84%)
JavaScript (0.81%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
852 Stars
406 Commits
143 Forks
20 Watchers
9 Branches
6 Contributors
Updated on Jul 03, 2025
Latest Version
19.0.0
Package Id
ngx-spinner@19.0.0
Unpacked Size
343.23 kB
Size
37.50 kB
File Count
74
NPM Version
10.5.0
Node Version
20.12.0
Published on
Feb 16, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
3
A library with more than 50 different loading spinners for Angular 4 - 19. (https://napster2210.github.io/ngx-spinner/)
Use appropriate version based on your Angular version.
Angular 19 | Angular 18 | Angular 17 | Angular 16 | Angular 15 |
---|---|---|---|---|
>=v19.0.0 | >=v18.0.0 | >=v17.0.0 | >=v16.0.2 | >=v15.0.1 |
Angular 14 | Angular 13 | Angular 12 | Angular 11 | Angular 10 |
---|---|---|---|---|
>=v14.0.0 | >=v13.1.1 | >=v12.0.0 | >=v11.0.2 | >=v10.0.1 |
Angular 9 | Angular 8 | Angular 6/7 | Angular 5 | Angular 4 |
---|---|---|---|---|
>=v9.0.1 | v8.1.0 | v7.2.0 | >=v1.2.0 | >=v2.0.0 |
![]() Chrome | ![]() Firefox | ![]() IE / Edge | ![]() Safari | ![]() Opera |
---|---|---|---|---|
Latest ✔ | Latest ✔ | IE11, Edge ✔ | Latest ✔ | Latest ✔ |
img
tagshow()/hide()
methods return promisez-index
hide/show
the spinnerngx-spinner
is available via npm and yarn
Using npm:
1$ npm install ngx-spinner --save
Using yarn:
1$ yarn add ngx-spinner
Using angular-cli:
1$ ng add ngx-spinner
Add css animation files to angular.json config
1{ 2 "styles": [ 3 "node_modules/ngx-spinner/animations/ball-scale-multiple.css" // ===> Add css file based on your animation name(here it's "ball-scale-multiple") 4 // You're able to add multiple files if you need 5 ] 6}
Import NgxSpinnerModule
in in the root module(AppModule
):
1import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core"; 2import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; 3// Import library module 4import { NgxSpinnerModule } from "ngx-spinner"; 5 6@NgModule({ 7 imports: [ 8 // ... 9 BrowserAnimationsModule, 10 NgxSpinnerModule, 11 ], 12 schemas: [CUSTOM_ELEMENTS_SCHEMA], 13}) 14export class AppModule {}
forRoot
method for NgxSpinnerModule and pass configuration object.1// Available options 2interface NgxSpinnerConfig { 3 type?: string; 4} 5// Use in app 6@NgModule({ 7 imports: [ 8 NgxSpinnerModule.forRoot({ type: 'ball-scale-multiple' }) 9 ] 10})
Add NgxSpinnerService
service wherever you want to use the ngx-spinner
.
1import { NgxSpinnerService } from "ngx-spinner"; 2 3class AppComponent implements OnInit { 4 constructor(private spinner: NgxSpinnerService) {} 5 6 ngOnInit() { 7 /** spinner starts on init */ 8 this.spinner.show(); 9 10 setTimeout(() => { 11 /** spinner ends after 5 seconds */ 12 this.spinner.hide(); 13 }, 5000); 14 } 15}
Now use in your template
1<ngx-spinner type="ball-scale-multiple"></ngx-spinner>
See Demo
NgxSpinnerService.show()
Shows the spinnerNgxSpinnerService.hide()
Hides the spinnerrgba(51,51,51,0.8)
where alpha
value(0.8) is opacity of backdropsmall
, default
, medium
, large
.
To set size of spinner, default large
#fff
true
or false
To enable/disable fullscreen mode(overlay), default true
primary
99999
null
true
or false
To show/hide spinner from template using variabletrue
or false
To enable/disable fade animation of spinner, default false
1<ngx-spinner 2 bdColor="rgba(51,51,51,0.8)" 3 size="medium" 4 color="#fff" 5 type="ball-scale-multiple" 6> 7 <p style="font-size: 20px; color: white">Loading...</p> 8</ngx-spinner>
1<ngx-spinner 2 bdColor="rgba(0, 0, 0, 1)" 3 template="<img src='https://media.giphy.com/media/o8igknyuKs6aY/giphy.gif' />" 4> 5</ngx-spinner>
HTML
code as loading text now, instead of input parameter(loadingText
). Check above code for reference.ngx-spinner
instance, just add name
attribute with ngx-spinner
component. But in this case, you've to pass that particular name of a spinner in show/hide
method. Check Demoangular.json
file1this.spinner.show("mySpinner", { 2 type: "line-scale-party", 3 size: "large", 4 bdColor: "rgba(0, 0, 0, 1)", 5 color: "white", 6 template: 7 "<img src='https://media.giphy.com/media/o8igknyuKs6aY/giphy.gif' />", 8});
type
will be ball-8bits
.ball-8bits
animation(e.g. ball-8bits.css
)CUSTOM_ELEMENTS_SCHEMA
as your schema in your main module.show()
methods in a single component or single function one after another then wrap the show()
method within setTimeout()
method to avoid any rendering issue.fullScreen: false
), in that case your parent element of spinner must have position: relative;
style property.ngx-spinner will be maintained under the Semantic Versioning guidelines. Releases will be numbered with the following format:
<major>.<minor>.<patch>
For more information on SemVer, please visit http://semver.org.
Inspired by Load Awesome by Daniel Cardoso.
Thanks Alex Vieira Alencar for helping me with Multiple Spinner Support.
Thanks ennjin for reducing the bundle size.
ngx-spinner is MIT licensed.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
security policy file detected
Details
Reason
Found 1/4 approved changesets -- score normalized to 2
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
15 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More