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-image-comparison-slider

v0.0.5

Published

Image comparison component with slider for Angular

Readme

ngx-image-comparison-slider

Image comparison component with slider, for Angular.
See an example here.
Works on mobile too!

Table of contents

  1. Installing
  2. Usage
  3. Additional Options
  4. Examples
  5. Licence

Installing

  • Run npm install ngx-image-comparison-slider to install library.
  • Import NgxImageComparisonSliderModule to your AppModule (or any module of choice).
    import {NgxImageComparisonSliderModule} from 'ngx-image-comparison-slider';
    @NgModule({
      imports: [ NgxImageComparisonSliderModule ],
      ...
    })
    export class AppModule { }

Usage

Simply use <ngx-image-comparison-slider> component anywhere in your template.

    <h1>Example</h1>
    <ngx-image-comparison-slider 
      src1='https://www.w3schools.com/html/pic_trulli.jpg' 
      src2='https://www.w3schools.com/html/img_girl.jpg'>
    </ngx-image-comparison-slider>

See more examples here

Additional options

| Option | Type | Default | Explanation | | ----------------------|---------------| --------------|-----------------------------------------------------------------------| | src1 | string | null | Source of the first (left-side) image | | src2 | string | null | Source of the second (right-side) image | | startPos | 'leftBorder' 'middle' 'rightBorder' number | 'middle' | Starting position for slider: Left, Centered, Right, or a number (measured from left, in px) | maxWidth | number | 600 | Maximum Width of the component in px | | maxHeight | number | 400 | Maximum Height of the component in px | | imageFit | 'cover' 'contain' 'fill' | 'cover' | Fit mode for images (using objectFit css property) | | leftBorder | number | 0 | Left maximum for sliding (in px) | | rightBorder | number | same as maxWidth | Right maximum for sliding (measured from left, in px) | | alt1 | string | 'sliderImage1'| Alt (name) of the first (left-side) image | | alt2 | string | 'sliderImage2'| Alt (name) of the second (right-side) image | | sliderWidth | number | 5 | Width of the slider line (in px) | | sliderColor | string (css collor) | 'whitesmoke' | Color of the slider line | | sliderShadow | bool | true | Shows or hides a slight shadow on the slider | | sliderBallSize | number | sliderWidth * 4 | Radius of circle in the middle of slider line | | sliderBallImageColor | 'black' 'white' | 'black' | Color of the icon image, inside of slider ball | | showSliderBall | bool | true | Show or hide slider ball | | calcSliderBallDif | bool | true | Take slider ball into consideration when calculating right and left borders for sliding | zIndexStart | number | 1000 | Defines the base for z-index property of images and slider |

Examples

Go ahead and experiment yourself on stackblitz!

Licence

The MIT License (MIT)

Copyright (c) 2021 Web-Ez LTD.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.