Gathering detailed insights and metrics for react-photoswipe
Gathering detailed insights and metrics for react-photoswipe
Gathering detailed insights and metrics for react-photoswipe
Gathering detailed insights and metrics for react-photoswipe
react-photoswipe-gallery
React component wrapper around PhotoSwipe
@types/react-photoswipe
TypeScript definitions for react-photoswipe
@codesyntax/ionic-react-photo-viewer
Ionic React photo viewer component
@andrew-wolf/react-photoswipe-gallery
React component wrapper around PhotoSwipe
npm install react-photoswipe
Typescript
Module System
Node Version
NPM Version
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
4
49
PhotoSwipe, PhotoSwipeGallery component for ReactJS base on PhotoSwipe.
1npm install --save react-photoswipe
1bower install --save react-photoswipe
1import 'react-photoswipe/lib/photoswipe.css';
1<link rel="stylesheet" type="text/css" href="path/to/react-photoswipe/lib/photoswipe.css">
1import {PhotoSwipe} from 'react-photoswipe'; 2 3let isOpen = true; 4 5let items = [ 6 { 7 src: 'http://lorempixel.com/1200/900/sports/1', 8 w: 1200, 9 h: 900, 10 title: 'Image 1' 11 }, 12 { 13 src: 'http://lorempixel.com/1200/900/sports/2', 14 w: 1200, 15 h: 900, 16 title: 'Image 2' 17 } 18]; 19 20let options = { 21 //http://photoswipe.com/documentation/options.html 22}; 23 24handleClose = () => { 25 isOpen: false 26}; 27 28<PhotoSwipe isOpen={isOpen} items={items} options={options} onClose={handleClose}/> 29
1import {PhotoSwipeGallery} from 'react-photoswipe'; 2 3let items = [ 4 { 5 src: 'http://lorempixel.com/1200/900/sports/1', 6 thumbnail: 'http://lorempixel.com/120/90/sports/1', 7 w: 1200, 8 h: 900, 9 title: 'Image 1' 10 }, 11 { 12 src: 'http://lorempixel.com/1200/900/sports/2', 13 thumbnail: 'http://lorempixel.com/120/90/sports/2', 14 w: 1200, 15 h: 900, 16 title: 'Image 2' 17 } 18]; 19 20let options = { 21 //http://photoswipe.com/documentation/options.html 22}; 23 24getThumbnailContent = (item) => { 25 return ( 26 <img src={item.thumbnail} width={120} height={90}/> 27 ); 28} 29 30<PhotoSwipeGallery items={items} options={options} thumbnailContent={getThumbnailContent}/>
1<link rel="stylesheet" type="text/css" href="path/to/react-photoswipe/dist/photoswipe.css"> 2<script src="path/to/react-photoswipe/dist/react-photoswipe.js"></script>
1var PhotoSwipe = window.ReactPhotoswipe.PhotoSwipe; 2var PhotoSwipeGallery = window.ReactPhotoswipe.PhotoSwipeGallery;
Example here
Note: The first argument of every listener is a Photoswipe instance.
EX:
1beforeChange(instance, change);
2imageLoadComplete(instance, index, item);
Name | Type | Default | Required | Description |
---|---|---|---|---|
isOpen | bool | false | true | |
items | array | [] | true | http://photoswipe.com/documentation/getting-started.html |
options | object | {} | false | http://photoswipe.com/documentation/options.html |
onClose | function | false | Callback after PhotoSwipe close | |
id | string | false | ||
className | string | pswp | ||
beforeChange | function | false | Photoswipe event listener | |
afterChange | function | false | Photoswipe event listener | |
imageLoadComplete | function | false | Photoswipe event listener | |
resize | function | false | Photoswipe event listener | |
gettingData | function | false | Photoswipe event listener | |
mouseUsed | function | false | Photoswipe event listener | |
initialZoomIn | function | false | Photoswipe event listener | |
initialZoomInEnd | function | false | Photoswipe event listener | |
initialZoomOut | function | false | Photoswipe event listener | |
initialZoomOutEnd | function | false | Photoswipe event listener | |
parseVerticalMargin | function | false | Photoswipe event listener | |
close | function | false | Photoswipe event listener | |
unbindEvents | function | false | Photoswipe event listener | |
destroy | function | false | Photoswipe event listener | |
updateScrollOffset | function | false | Photoswipe event listener | |
preventDragEvent | function | false | Photoswipe event listener | |
shareLinkClick | function | false | Photoswipe event listener |
Name | Type | Default | Required | Description |
---|---|---|---|---|
items | array | [] | true | http://photoswipe.com/documentation/getting-started.html |
options | object | {} | false | http://photoswipe.com/documentation/options.html |
thumbnailContent | function | <img src={item.src} width='100' height='100'/> | false | Thumbnail content |
isOpen | bool | false | false | Use it with onClose prop |
onClose | function | false | Callback after close | |
id | string | false | ||
className | string | pswp-gallery | ||
beforeChange | function | false | Photoswipe event listener | |
afterChange | function | false | Photoswipe event listener | |
imageLoadComplete | function | false | Photoswipe event listener | |
resize | function | false | Photoswipe event listener | |
gettingData | function | false | Photoswipe event listener | |
mouseUsed | function | false | Photoswipe event listener | |
initialZoomIn | function | false | Photoswipe event listener | |
initialZoomInEnd | function | false | Photoswipe event listener | |
initialZoomOut | function | false | Photoswipe event listener | |
initialZoomOutEnd | function | false | Photoswipe event listener | |
parseVerticalMargin | function | false | Photoswipe event listener | |
close | function | false | Photoswipe event listener | |
unbindEvents | function | false | Photoswipe event listener | |
destroy | function | false | Photoswipe event listener | |
updateScrollOffset | function | false | Photoswipe event listener | |
preventDragEvent | function | false | Photoswipe event listener | |
shareLinkClick | function | false | Photoswipe event listener |
View demo or example folder.
No vulnerabilities found.
No security vulnerabilities found.