Gathering detailed insights and metrics for @hreimer/angular-image-viewer
Gathering detailed insights and metrics for @hreimer/angular-image-viewer
Gathering detailed insights and metrics for @hreimer/angular-image-viewer
Gathering detailed insights and metrics for @hreimer/angular-image-viewer
Image Viewer For Angular 11+ . It also has various functionality like Image FullScreen, Rotate, Zoom etc.
npm install @hreimer/angular-image-viewer
Typescript
Module System
Node Version
NPM Version
TypeScript (65.73%)
HTML (18.99%)
JavaScript (8.25%)
SCSS (7.03%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
4 Stars
87 Commits
20 Forks
10 Branches
1 Contributors
Updated on Sep 22, 2023
Latest Version
0.14.1
Package Id
@hreimer/angular-image-viewer@0.14.1
Unpacked Size
186.88 kB
Size
28.08 kB
File Count
20
NPM Version
8.11.0
Node Version
16.15.1
Published on
Mar 16, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
3
A configurable Angular image viewer component, compatible with Angular 11.x+
npm install @hreimer/angular-image-viewer
Note: Refer to the official links how to set-up your app if you want to use FontAwesome Icons (https://github.com/FortAwesome/angular-fontawesome) or Material Icons (https://material.angular.io/guide/getting-started).
To use default configuration, simply import the ImageViewerModule into your module, like so:
1import { AngularImageViewerModule } from "@hreimer/angular-image-viewer"; 2 3@NgModule({ 4 //... 5 imports: [ 6 //... 7 AngularImageViewerModule 8 ], 9 //... 10})
Then, add the component to your template, providing an array of image URLs. You can also optionally add an index, to indicate which image should be shown first. The default will be the first item in the array.
1<angular-image-viewer [src]="images" [(index)]="imageIndex"></angular-image-viewer>
By default, the image viewer will fill its container. If you wish to restrict the size, simply place it within a div, and set the size constraints on the div.
Configuration can be provided at the module level (by passing the object as an argument to forRoot()
, or at the component level, by passing it as the config
input. Any configuration provided at the component level will override that which is set at the module level.
The configuration object is structured as below. All values are optional, and if omitted, the default value shown below will be used.
1{ 2 btnContainerClass: '', // The CSS class(es) to be applied to the button container 3 btnClass: 'default', // The CSS class(es) that will be applied to the buttons e.g. default is needed for FontAwesome icons, while not needed for Material Icons 4 btnSubClass: 'material-icons', // The CSS class(es) that will be applied to span elements inside material buttons (a Elements) 5 zoomFactor: 0.1, // The amount that the scale will be increased by 6 containerBackgroundColor: '#ccc', // The color to use for the background. This can provided in hex, or rgb(a). 7 wheelZoom: true, // If true, the mouse wheel can be used to zoom in 8 allowFullscreen: true, // If true, the fullscreen button will be shown, allowing the user to enter fullscreen mode 9 allowKeyboardNavigation: true, // If true, the left / right arrow keys can be used for navigation 10 btnShow: { // Control which icons should be visible 11 zoomIn: true, 12 zoomOut: true, 13 rotateClockwise: true, 14 rotateCounterClockwise: true, 15 next: true, 16 prev: true, 17 reset: true 18 }, 19 btnIcons: { // The icon classes that will apply to the buttons. By default, font-awesome is used. 20 zoomIn: { 21 classes: 'fas fa-plus', // this property will be used for FontAwesome and other libraries to set the icons via the classes - choose one: classes or text 22 text: 'zoom_in' // this property will be used for Material-Icons and similar libraries to set the icons via the text 23 }, 24 zoomOut: { 25 classes: 'fas fa-minus', 26 text: 'zoom_out' 27 }, 28 rotateClockwise: { 29 classes: 'fas fa-repeat', 30 text: 'rotate_right' 31 }, 32 rotateCounterClockwise: { 33 classes: 'fas fa-undo', 34 text: 'rotate_left' 35 }, 36 next: { 37 classes: 'fas fa-arrow-right', 38 text: 'arrow_right' 39 }, 40 prev: { 41 classes: 'fas fa-arrow-left', 42 text: 'arrow_left' 43 }, 44 fullscreen: { 45 classes: 'fas fa-arrows-alt', 46 text: 'fullscreen' 47 }, 48 reset: { 49 classes: 'fas fa-undo', 50 text: 'restore' 51 } 52 } 53};
To add additional buttons use the following
1<angular-image-viewer [src]="images" 2 [config]="{ 3 customBtns: [ 4 { 5 name: 'link', 6 icon: { 7 classes: 'fas fa-paperclip', 8 text: 'link' 9 } 10 } 11 ] 12 }" 13 (customImageEvent)="handleEvent($event)"> 14</angular-image-viewer>
1handleEvent(event: customImageEvent) { 2 console.log(`${event.name} has been clicked on img ${event.imageIndex + 1}`); 3 4 switch (event.name) { 5 case 'print': 6 console.log('run print logic'); 7 break; 8 } 9}
Note: This package builts on the idea from angular-x-image-viewer (https://github.com/deepakgonda/angular-image-viewer) and adds support for Material Icons as well as introduces a Reset Button and structures the buttons horizontally in another customisable container.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/8 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
43 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More