Gathering detailed insights and metrics for react-images-viewer
Gathering detailed insights and metrics for react-images-viewer
Gathering detailed insights and metrics for react-images-viewer
Gathering detailed insights and metrics for react-images-viewer
react-wx-images-viewer
Images viewer is a react component use in mobile website App, that function same as Weixin native viewer.
@haz3l/react-images-viewer
Create an react-images-viewer component.
react-pdf
Display PDFs in your React app as easily as if they were images.
images-viewer-react
images viewer react
A react library that view photos list easily, and a simple, responsive viewer component for displaying an array of images.
npm install react-images-viewer
Typescript
Module System
Node Version
NPM Version
80.5
Supply Chain
95.7
Quality
74.7
Maintenance
100
Vulnerability
99.6
License
JavaScript (99.54%)
Shell (0.46%)
Total Downloads
1,157,119
Last Day
133
Last Week
5,679
Last Month
24,128
Last Year
300,088
MIT License
165 Stars
189 Commits
41 Forks
2 Watchers
6 Branches
3 Contributors
Updated on Jun 14, 2025
Minified
Minified + Gzipped
Latest Version
1.7.1
Package Id
react-images-viewer@1.7.1
Unpacked Size
209.32 kB
Size
46.34 kB
File Count
63
NPM Version
8.3.0
Node Version
17.0.1
Cumulative downloads
Total Downloads
Last Day
2.3%
133
Compared to previous day
Last Week
1.4%
5,679
Compared to previous week
Last Month
5.2%
24,128
Compared to previous month
Last Year
-5.2%
300,088
Compared to previous year
41
A react library that view photos list easily, and a simple, responsive viewer component for displaying an array of images.
1# recommended 2yarn add react-images-viewer
or
1npm install react-images-viewer --save
1import React from "react"; 2import ImgsViewer from "react-images-viewer"; 3 4export default class Demo extends React.Component { 5 render() { 6 return ( 7 <ImgsViewer 8 imgs={[ 9 { src: "http://example.com/img1.jpg" }, 10 { src: "http://example.com/img2.png" }, 11 ]} 12 currImg={this.state.currImg} 13 isOpen={this.state.viewerIsOpen} 14 onClickPrev={this.gotoPrevious} 15 onClickNext={this.gotoNext} 16 onClose={this.closeViewer} 17 /> 18 ); 19 } 20}
Live Demo: guonanci.github.io/react-images-viewer
1yarn install 2yarn 3yarn start
Then open localhost:8000
in a browser.
Example using srcSet:
1<ImgsViewer 2 imgs={IMG_SET} 3 ... 4/>
1const IMG_SET = [ 2 { 3 src: "http://example.com/img1.svg", 4 caption: "A forest", 5 // As an array 6 srcSet: [ 7 "http://example.com/img1_1024.jpg 1024w", 8 "http://example.com/img1_800.jpg 800w", 9 "http://example.com/img1_500.jpg 500w", 10 "http://example.com/img1_320.jpg 320w", 11 ], 12 }, 13 { 14 src: "http://example.com/img2.svg", 15 // As a string 16 srcSet: 17 "http://example.com/img2_1024.jpg 1024w, http://example.com/img2_800.jpg 800w, http://example.com/img2_500.jpg 500w, http://example.com/img2_320.jpg 320w", 18 }, 19];
Property | Type | Default | Description |
---|---|---|---|
backdropCloseable | boolean | false | Allow users to exit the viewer by clicking the backdrop |
closeBtnTitle | str | undefined | Customize close esc title |
enableKeyboardInput | boolean | true | Supports keyboard input - space, esc , arrow left, arrow up , and arrow right, arrow down |
currImg | number | 0 | Required if you want to navigate the imgsViewer, The index of the image to display initially |
customControls | arr | undefined | An array of elements to display as custom controls on the top of viewer |
imgs | arr | undefined | Required. Array of image objects, See img opts table below |
imgCountSeparator | str | ' / ' | Customize separator in the image count |
isOpen | boolean | false | Required if you want to navigate the imgsViewer, Whether or not the viewer is displayed |
leftArrowTitle | str | undefined | Customize of left arrow title |
onClickPrev | function | undefined | Required if you want to navigate the imgsViewer, and fired on request of the previous image |
onClickNext | function | undefined | Required if you want to navigate the imgsViewer, and fired on request of the next image |
onClose | function | undefined | Required if you want to close the imgsViewer, and handle closing of the viewer |
onClickImg | function | undefined | Handle click on current image |
onClickThumbnail | function | undefined | Handle click on thumbnail |
preloadNextImg | boolean | true | Whether to preload the next available image |
rightArrowTitle | str | undefined | Customize right arrow title |
showCloseBtn | boolean | true | Optionally display a close 'X' button in top right corner |
showImgCount | boolean | true | Optionally display image index, e.g., "2 of 20" |
width | number | 1024 | Maximum width of the carousel; defaults to 1024px |
spinnerDisabled | boolean | false | Disable Spinner |
spinner | function | DefaultSpinner | Spinner component class |
spinnerColor | str | '#fff' | Color of spinner |
spinnerSize | number | 50 | Size of spinner |
preventAutoScroll | boolean | true | Determines whether auto-scrolling is prevented |
| Property | Type | Default | Description |
| :------- | :-------- | :---------- | :---------- | -------- |
| src | str
| undefined
| Required |
| srcSet | string[] | string
| undefined
| Optional |
| caption | str
| undefined
| Optional |
| alt | str
| undefined
| Optional |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/10 approved changesets -- score normalized to 2
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
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
100 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-16
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