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

smp-image-viewer

v1.0.3

Published

Responsive image viewer that adapts to different container sizes and multiple display styles.

Downloads

5

Readme

smp-image-viewer

smp-image-viewer is an NPM component designed to display images responsively with different viewing modes. It allows you to adjust the image within a container without distortion, ensuring an optimal presentation on any device. Additionally, it includes an option to view the image in full screen and a fallback image in case the original one fails to load.

Demo

You can view a live demo of the component here.

Installation

You can install the package via npm:

npm install smp-image-viewer

Or with Yarn:

yarn add smp-image-viewer

Usage

Importing the module

You can import the component directly in any module or component:

import { Component } from '@angular/core';
import { ImageViewerComponent } from 'smp-image-viewer';

@Component({
  selector: 'app-root',
  imports: [ImageViewerComponent],
  templateUrl: './app.component.html',
})
export class AppComponent {
  imageSRC = 'https://example.com/image.jpg';
}

Usage in HTML

Once the component is imported, you can use it and its properties in your template file:

<smp-image-viewer 
  [src]="imageSRC" 
  [alignment]="'scaleAspectToFit'" 
  [width]="'300px'" 
  [height]="'300px'" 
  [borderRadius]="16">
</smp-image-viewer>

Props

| Property | Type | Description | Default Value | | ----------------| ------- | ----------------------------------------------------------------------------------------- | ----------------- | | src | string | URL of the image to display (any valid source). | | | alt | string | Alt text for the image. | | | alignment | string | Display mode (scaleToFill, scaleAspectToFit, scaleAspectToFill). | 'scaleToFill' | | position | string | Position of the image within the container (top, bottom, center, left, right). | 'center' | | noImageSRC | string | URL of the image to display when src is unavailable. | Suggested image | | responsive | boolean | Enables responsive image adjustment. | false | | noImageVisible| boolean | Controls whether the fallback image is shown when src is unavailable. | true | | borderRadius | number | Border radius of the image container. | 0 | | fullImage | boolean | Enables full-screen image view. | true | | width | string | Width of the container. | '100%' | | height | string | Height of the container. | '100%' |

Display Modes

  • scaleToFill: Scales the image to completely fill the container, without maintaining the aspect ratio.
  • scaleAspectToFit: Scales the image to fit completely within the container without distortion.
  • scaleAspectToFill: Scales the image to cover the container completely, maintaining the aspect ratio but cropping if necessary.

Contributions

Contributions are welcome! If you’d like to improve this package, please open an issue or submit a pull request on the repository.

License

This project is licensed under the MIT License.


Let me know if you need further adjustments!