All Projects → Napster2210 → Ngx Spinner

Napster2210 / Ngx Spinner

Licence: mit
A library for loading spinner for Angular 4/5/6/7/8/9/10.

Projects that are alternatives of or similar to Ngx Spinner

Spinners React
Lightweight SVG/CSS spinners for React
Stars: ✭ 254 (-53.39%)
Mutual labels:  spinner, loading-spinner
ngx-loading-mask
Angular 5+ simple loading-mask ui component.
Stars: ✭ 22 (-95.96%)
Mutual labels:  ngx, loading-spinner
respinner
Pretty and customizable svg spinners for React.js
Stars: ✭ 89 (-83.67%)
Mutual labels:  spinner, loading-spinner
Whirl
CSS loading animations with minimal effort!
Stars: ✭ 774 (+42.02%)
Mutual labels:  spinner, loading-spinner
busy-load
A flexible loading-mask jQuery-plugin
Stars: ✭ 76 (-86.06%)
Mutual labels:  spinner, loading-spinner
Ng4 Loading Spinner
Angular 4 custom async loading spinner.
Stars: ✭ 74 (-86.42%)
Mutual labels:  spinner, loading-spinner
Vue Progress Path
Progress bars and loading indicators for Vue.js
Stars: ✭ 309 (-43.3%)
Mutual labels:  spinner, loading-spinner
Respin
React SVG loading spinner based on jxnblk.com/loading
Stars: ✭ 21 (-96.15%)
Mutual labels:  spinner, loading-spinner
cpp-indicators
A very simple, easy-to-use, and single-header-only C++ library for console based indicators (loading spinners)
Stars: ✭ 13 (-97.61%)
Mutual labels:  spinner, loading-spinner
react-native-spinner-button
React Native button component with multiple animated spinners
Stars: ✭ 105 (-80.73%)
Mutual labels:  spinner, loading-spinner
loading
Laravel package to add loading indicator to pages while page is loading.
Stars: ✭ 38 (-93.03%)
Mutual labels:  spinner, loading-spinner
React Epic Spinners
Reusable react components for epic-spinners
Stars: ✭ 280 (-48.62%)
Mutual labels:  spinner, loading-spinner
spinnies
Node.js module to create and manage multiple spinners in command-line interface programs
Stars: ✭ 111 (-79.63%)
Mutual labels:  spinner, loading-spinner
material-circular-loader
Material Circular Loader in SCSS like a boss. Demo: http://codepen.io/YuRen/details/KdKKax
Stars: ✭ 13 (-97.61%)
Mutual labels:  spinner, loading-spinner
Epic Spinners
Easy to use css spinners collection with Vue.js integration
Stars: ✭ 3,548 (+551.01%)
Mutual labels:  spinner, loading-spinner
Ng Http Loader
🍡 Smart angular HTTP interceptor - Intercepts automagically HTTP requests and shows a spinkit spinner / loader / progress bar
Stars: ✭ 327 (-40%)
Mutual labels:  spinner
Tty Spinner
A terminal spinner for tasks that have non-deterministic time frame.
Stars: ✭ 386 (-29.17%)
Mutual labels:  spinner
Ngx Materialize
Angular wrap around Materialize library
Stars: ✭ 322 (-40.92%)
Mutual labels:  ngx
Spinnerdatepicker
A styleable DatePicker for Android using the old spinner style (NumberPickers)
Stars: ✭ 314 (-42.39%)
Mutual labels:  spinner
Powerspinner
🌀 A lightweight dropdown popup spinner with a fully customizable arrow and animations.
Stars: ✭ 493 (-9.54%)
Mutual labels:  spinner

A library with more than 50 different loading spinners for Angular 4/5/6/7/8/9/10. (https://napster2210.github.io/ngx-spinner/)

NgxSpinner

Support Support Support Support Support Support Support License devDependency Status Gitter

What's New

  • Angular 10 support 🥳🥳🥳🥳
  • Latest Angular Dependencies
  • ng add command to add ngx-spinner to the project
  • Bug Fixes

Use appropriate version based on your Angular version.

Angular 4 Angular 5 Angular 6/7 Angular 8 Angular 9 Angular 10
>= v1.2.0 >= v2.0.0 v7.2.0 v8.1.0 >=v9.0.1 >=v10.0.1

Table of contents

Browser Support

ChromeChrome FirefoxFirefox IE / EdgeIE / Edge iOS SafariSafari OperaOpera
Latest ✔ Latest ✔ IE11, Edge ✔ Latest ✔ Latest ✔

Features

  • Angular 10 Support
  • Custom spinner image support(gif), you can pass img tag
  • Multiple Spinners
  • Configurable option through service
  • Fullscreen Mode(Enable/Disable)
  • show()/hide() methods return promise
  • Dynamic z-index
  • Smooth animation while hide/show the spinner
  • New updated DEMO website

Demo

Working Demo

StackBlitz Demo

Installation

ngx-spinner is available via npm and yarn

Using npm:

$ npm install ngx-spinner --save

Using yarn:

$ yarn add ngx-spinner

Using angular-cli:

$ ng add ngx-spinner

Usage

Import NgxSpinnerModule in in the root module(AppModule):

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
// Import library module
import { NgxSpinnerModule } from "ngx-spinner";

@NgModule({
  imports: [
    // ...
    NgxSpinnerModule
  ],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}

Add NgxSpinnerService service wherever you want to use the ngx-spinner.

import { NgxSpinnerService } from "ngx-spinner";

class AppComponent implements OnInit {
  constructor(private spinner: NgxSpinnerService) {}

  ngOnInit() {
    /** spinner starts on init */
    this.spinner.show();

    setTimeout(() => {
      /** spinner ends after 5 seconds */
      this.spinner.hide();
    }, 5000);
  }
}

Now use in your template

<ngx-spinner></ngx-spinner>

See Demo

Methods

  • NgxSpinnerService.show() Shows the spinner
  • NgxSpinnerService.hide() Hides the spinner

Available Options

  • [bdColor]: RGBA color format. To set background-color for backdrop, default rgba(51,51,51,0.8) where aplha value(0.8) is opacity of backdrop
  • [size]: Anyone from small, default, medium, large. To set size of spinner, default large
  • [color]: Any css color format. To set color of spinner, default #fff
  • [type]: Choose any animation spinner from Load Awesome. To set type of spinner, default ball-scale-multiple
  • [fullScreen]: true or false To enable/disable fullscreen mode(overlay), default true
  • [name]: For multiple spinners To set name for spinner, default primary
  • [zIndex]: For dynamic z-index To set z-index for the spinner, default 99999
  • [template]: For custom spinner image To set custom template for the custom spinner, default null

Using Spinner Type

<ngx-spinner
  bdColor="rgba(51,51,51,0.8)"
  size="medium"
  color="#fff"
  type="ball-scale-multiple"
>
  <p style="font-size: 20px; color: white">Loading...</p>
</ngx-spinner>

Using Custom Spinner

<ngx-spinner
  bdColor="rgba(0, 0, 0, 1)">
  template="<img src='https://media.giphy.com/media/o8igknyuKs6aY/giphy.gif' />" 
</ngx-spinner>

NOTE

  • You can pass HTML code as loading text now, instead of input parameter(loadingText). Check above code for reference.
  • If you want multiple 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 Demo
  • You can also change the options/configuration of spinner through service now.
this.spinner.show("mySpinner", {
  type: "line-scale-party",
  size: "large",
  bdColor: "rgba(0, 0, 0, 1)",
  color: "white",
  template: "<img src='https://media.giphy.com/media/o8igknyuKs6aY/giphy.gif' />"
});

How to use type?

  • Go to the Load Awesome.
  • Select any animation, copy name of animation, replace all spaces with hyphen(-) and all letters should be lowercase.
    • Let's say if I select "Ball 8bits" animation then type will be ball-8bits.
    • For more information you can check it out Demo

Useful Tips

  • Make sure you've added CUSTOM_ELEMENTS_SCHEMA as your schema in your main module.
  • If you use multiple 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.
  • When you want to use spinner inside any container(fullScreen: false), in that case your parent element of spinner must have position: relative; style property.
  • You can't set custom template through service options, it's a limitation by Angular itself.

Versioning

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.

Creator

Yuvraj Chauhan

Future Plan

  • Interceptor Implementation
  • Smaller bundle

Ask Me

  • Now you can directly send me a message on Gitter for any query/suggestion/updates

Credits

Inspired by Load Awesome by Daniel Cardoso.

Thanks Alex Vieira Alencar for helping me with Multiple Spinner Support.

License

ngx-spinner is MIT licensed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].