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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ngx-progressive-img-loader

v0.1.0

Published

A simple, flexible progressive image loader for angular 4+

Downloads

29

Readme

Ngx-progressive-img-loader

Ngx-progressive-img-loader is a simple progressive image loader for Angular4+. It's easy to use and yet flexible. It uses the blur low resolution transition to high resolution technique to achieve a sleek progressive loading.

Demo

ngx-progressive-img-loader demo

See a Ionic 3 demo on stackblitz.com Also see a demo on stackblitz.com

Features

  • No use of external dependencies, implemented with Angular APIs.
  • Responsive progressive placeholder and images.
  • Provides API to maintain aspect ratio of the pre-loaded image.
  • Very fast and a light-weight library.
  • Provides API for easy reuse and out-of-box styling in your project.
  • Applies nice blur and transitioning to achieve a sleek pre-loading feel.
  • Ngx-progressive-img-loader can serve as a parent for other components.

Install

npm i ngx-progressive-img-loader --save

Open your module file e.g app.module.ts and update imports array

import  {  NgxProgressiveImgLoaderModule  }  from  'ngx-progressive-img-loader';
...
imports: [
...
NgxProgressiveImgLoaderModule
...
]

And that's all.

Usage

All APIs

<ngx-progressive-img-loader
	[height]="'320px'"
	[width]="'100%'"
	(imageLoaded)="onImgLoad($event)"
	(thumbnailLoaded)="onThumbLoad($event)"
	[overlayTint]="'rgba(0,0,0,0)'"
	[preserveAspectRatio]="true"
	[placeholderBgColor]="'grey'"
	[placeholderImg]="'url-to-placeholder-image'"
	[img]="'url-to-high-res-image'"
	[thumbnail]="'url-to-very-low-res-image'"
	[fallbackImg]="'url-to-fall-back-image'">
	<!-- content goes here (optional) -->
</ngx-progressive-img-loader>

  • [height] : The height of the pre-loaded image. (required!)
  • [width]: The width of the pre-loaded image. (required!)
  • (imageLoaded): Event fired on success or error in loading of the high resolution image. (required!)
  • (thumbnailLoaded): Event fired on success or error in loading of the low res/thumbnail image. (required!)
  • [overlayTint]: Adds overlay tint/color/shade to your preloaded image. (optional)
  • [preserveAspectRatio]: If true, the pre-loaded image will fit into the pre-loader container without losing it's aspect ratio. If false, then it won't fit to aspect ratio. default: false; (optional)
  • [placeholderBgColor]: The background color of the image pre-loader container element. (optional)
  • [placeholderImg]: The background image of the image pre-loader container element. (optional)
  • [img]: The URL to the high resolution image you want to load. (required)
  • [thumbnail]: The URL to the very low quality, thumbnail sized version of the high resolution image you want to load. (required)
  • [fallbackImg]: The URL to the image to load if the high resolution image you want to load failed loading. (optional)

Note: You can place components or html elements inside the <ngx-progressive-img-loader> // your content goes here </ngx-progressive-img-loader> so as the component can serve as a parent element or background for the contents you want to place in it.

Events

<ngx-progressive-img-loader> component emits two events to it's parent component.

  • (imageLoaded): This output can be used to handle events emitted, when the high resolution image you want to load encounter an error or successfully loaded.
  • (thumbnailLoaded): This output can be used to handle events emitted, when the low resolution image you want to load encounter an error or successfully loaded.

The object emitted

	// loaded: true if the image is successfully loaded, otherwise false
	{loaded:  <true|false>, event:  e}

Example

A simple example:

<ngx-progressive-img-loader
	[height]="'450px'"
	[width]="'100%'"
	(imageLoaded)="onImgLoad($event)"
	(thumbnailLoaded)="onThumbLoad($event)"
	[img]="'https://res.cloudinary.com/lasudev/image/upload/c_fill,g_center,h_1610,q_auto:best/v1530475355/meetup_pictures/IMG-20180407-WA0011.png'"
	[thumbnail]="'https://res.cloudinary.com/lasudev/image/upload/c_fill,g_center,h_100,q_auto:best/v1530475355/meetup_pictures/IMG-20180407-WA0011.png'">
</ngx-progressive-img-loader>

Then in example.component.ts:

....
onImgLoad(e)
{
    console.log("High quality image loaded?", e.loaded);
}
onThumbLoad(e)
{
    console.log("Low qaulity thumbnail loaded?", e.loaded);
}
....

Todo

  • Implement content place holder gradient background animation.
  • Implement progress bar/ circle to indicate image load level.
  • Target for Webcomponent for other front-end frameworks to use it.

Contributing

  • Your commits conform to the conventions established here