npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@joshdoescode/spinner-component

v1.0.0

Published

There are currently 6 spinners/loaders to pick from.

Readme

Angular 5 Spinner Component

There are currently 6 spinners/loaders to pick from.

Installation

Run 'npm install --save @joshdoescode/spinner-component' form the root of your project.

In your 'app.module.ts' add the spinner module and service to your project:

import { SpinnerModule, SpinnerService } from '@joshdoescode/spinner-component/dist/';

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ...
    SpinnerModule <--
  ],
  providers: [
    ...
    SpinnerService <--
  ],
  ...
})
export class AppModule { }

The Component

To add the spinner to your UI you simply need to add the below to a component that will be present when you want to use it. If you will be using the spinner a lot; consider adding it to a footer component, or even the 'App.Component' itself.

<app-spinner></app-spinner>

Properties

[spinner] (number, default: 0) - The spinner that you want to be used, starting at 0.

[baseColour] (string, defaults to spinner default) - A hex code to be used with some of the spinners to change their solid colours. This string must include the '#' sign (e.g. '#ff0000').

[useScreen] (boolean, default: true) - Whether to also display a screen over the other content of the page, to prevent interaction whilst the spinner is displayed.

[screenOpacity] (number, default 40) - Opacity of the 'screen' used to block interaction with the UI whilst the spinner is displayed, as a percentage. Do not include the percentage sign.

Property example

<app-spinner [spinner]="5" [baseColour]="'#ff0000'" [screenOpacity]="90"></app-spinner>

The Service

The service is used for one thing: turning the spinner off and on. By default it is 'off'.

To use the service, inject it into a component/service, and then call its methods:

import { SpinnerService } from '@joshdoescode/spinner-component/dist';

@Component({
  ...
})
export class HomeComponent implements OnInit {
  
  constructor(private _spinnerService: SpinnerService) { <---
    ...
  }
    
  ngOnInit() { }
}

Methods

toggleShowSpinner() - Show or hide the spinner, based on its current status.

showSpinner() - Display the spinner.

hideSpinner() - Hide the spinner.

Method example

import { SpinnerService } from '@joshdoescode/spinner-component/dist';

@Component({
  ...
})
export class HomeComponent implements OnInit {

  constructor(private _spinnerService: SpinnerService) {
    ...
  }

  public makeApiCall() {
    this._spinnerService.showSpinner(); <---
    ...
  }

  ngOnInit() { }
}

The Spinners

#0 - Classic rotation circle, which also cycles colours.

#1 - 'loading' text, with large solid colour plane icon circling it. The color of this can be altered with the '[baseColour]' component property.

#2 - 'Loading' text, with large outlined plane icon circling, both cycling colours in sync with each other.

#3 - 'Loading' text, cycling colours.

#4 - 'Loading' text, with small outlined plane icon circling, both cycling colours in sync with each other.

#5 - Semi-solid coloured globe, with a small outlined plane icon circling. The color of this can be altered with the '[baseColour]' component property.

.