Gathering detailed insights and metrics for react-gallery-designer
Gathering detailed insights and metrics for react-gallery-designer
Gathering detailed insights and metrics for react-gallery-designer
Gathering detailed insights and metrics for react-gallery-designer
npm install react-gallery-designer
Typescript
Module System
Node Version
NPM Version
66.3
Supply Chain
92.9
Quality
75.7
Maintenance
100
Vulnerability
100
License
JavaScript (99.52%)
HTML (0.48%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
92,468
Last Day
68
Last Week
407
Last Month
1,806
Last Year
25,644
MIT License
2 Stars
101 Commits
1 Forks
2 Watchers
7 Branches
1 Contributors
Updated on Jun 23, 2022
Minified
Minified + Gzipped
Latest Version
1.4.5
Package Id
react-gallery-designer@1.4.5
Unpacked Size
102.79 kB
Size
31.52 kB
File Count
7
NPM Version
6.14.9
Node Version
14.15.3
Cumulative downloads
Total Downloads
Last Day
61.9%
68
Compared to previous day
Last Week
6.8%
407
Compared to previous week
Last Month
12.7%
1,806
Compared to previous month
Last Year
-2.4%
25,644
Compared to previous year
28
1$ yarn add react-gallery-designer
1$ npm install react-gallery-designer
The UMD build is also available on unpkg:
1<script src="https://unpkg.com/react-gallery-designer/umd/react-gallery-designer.min.js"></script>
If you use the UMD build you can find the library on window.__RGD
.
type: array
description: Array of objects representing the props for each image. This library uses react-image-designer for each image (and thumbnail) in the gallery. In addition to the props from react-image-designer
, you may also define the following:
default: ""
type: string
description: Url to link image.
default: false
type: boolean
description: add target="_blank" rel="noopener noreferrer"
to the a
tag.
default: 0
type: number
description: Index of image in array. Array will be sorted to user defined order if index is provided.
default: ""
type: string
description: Caption for image.
additionally the following props are not modifiable on the image object because they are either taken care of at the global level, or are handled by react-gallery-designer
internally (and changing that would break it):
default: false
type: boolean
description: Displays all images in a row wrap
flex-box, and expands an image to full screen on click with "next", and "prev" controls. Returns to previous view state on click when expanded.
default: 1
type: number
description: Number of images visible on screen at one time.
default: false
type: boolean
description: If slide should start rotating right away.
default: false
type: boolean
description: Useful for a rotating rss feed or similar application.
default: "left"
type: string
description: Direction in which the gallery should rotate. Options include "left", "right", "up", "down".
default: "horizontal"
type: string
description: Orient gallery vertically or horizontally.
default: "slide"
type: string
description: Type of animation for gallery. Options include "slide", "carousel", "book", "flip", "fade".
default: 2000
type: number
description: How much time (in milliseconds) each image will remain in place.
default: "ease-in-out"
type: string
description: css timing function for transitions.
default: 0.25
type: number
description: How fast the transitions are.
default: false
type: boolean
description: Puts a play/pause button in the top left (while mouse is over gallery container).
default: false
type: boolean
description: If the gallery should pause while hovering.
default: false
type: boolean
description: Puts arrow on the left and right of the gallery container (while mouse is over gallery container).
default: 1
type: number
description: How many images the gallery should advance every interval.
default: "center"
type: string
description: Position of the first image in the gallery relative to other images in view. Options include "left", "right", "center".
default: false
type: boolean
description: If caption
prop is supplied for each image, display caption over image.
default: false
type: boolean
description: If link
prop is supplied for each image, make image a clickable link.
default: false
type: boolean
description: Displays thumbnails under gallery container. Brings corresponding image into view on click.
default: false
type: boolean
description: Sets background-size
of image to contain
.
default: "▶"
type: string
description: HTML to use for play button.
default: "⏸"
type: string
description: HTML to use for pause button.
default: "›"
type: string
description: HTML to use for next button.
default: "‹"
type: string
description: HTML to use for prev button.
default: "div"
type: string
description: Tag to use for images. Will use src
if img
is used. Else images will render as background-image
.
default: thumbnails ? 80 : 100
type: number
description: Percent of the height of the gallery container to use as the height of each image.
default: thumbnails ? 15 : 0
type: number
description: Percent of the height of the gallery container to use as the height of each thumbnail.
default: 30
type: number
description: Percent of the height of the gallery container to use as the height of each small lightbox image.
description: Style for to the gallery container.
description: Style for to the thumbnails.
description: Style for to the images.
description: Style for to the captions.
description: Style for to full screen images when in lightbox mode.
description: Style for to the play/pause and next/prev buttons.
description: Class for the gallery container.
description: Id for the gallery container.
description: Class for gallery images.
description: Class for image captions.
description: Class for thumbnail images.
description: Class for the play/pause and next/prev buttons.
1import Gallery from "react-gallery-designer"; 2 3const ids = [15, 20, 25, 30, 35, 40, 45, 50 , 55, 145, 150]; 4 5const images = ids.map((id, i) => ({ 6 src: `/imgs/IMG_${id}-1900.jpg`, 7 placeholder: `/imgs/IMG_${id}-100.jpg`, 8 srcset: `/imgs/IMG_${id}-1900.jpg 1900w, 9 /imgs/IMG_${id}-1200.jpg 1200w, 10 /imgs/IMG_${id}-768.jpg 768w, 11 /imgs/IMG_${id}-480.jpg 480w, 12 /imgs/IMG_${id}-300.jpg 300w`, 13 sizes: `(max-width: 320px) 320w, 14 (max-width: 480px) 480w, 15 (max-width: 768px) 768w, 16 (max-width: 1200px) 1200w, 17 1900px`, 18 link: `https://link-${id}.com`, 19 target: true, 20 index: i, 21 caption: `super cool caption ${i}`, 22 style: {borderRight: "red solid 10px"}, 23 repeat: true, 24 position: "bottom right", 25 children: "... some more children here ...", 26 alt: "SOOPERKEWLIMGOMG", 27 timeout: 500 28})); 29 30const settings = { 31 lightbox: false, 32 inview: 5, 33 auto: true, 34 noImages: false, 35 direction: "right", 36 orientation: "horizontal", 37 animation: "carousel", 38 speed: 3500, 39 timingfn: "linear", 40 transitionspeed: 0.333333, 41 playpause: true, 42 pauseonhover: true, 43 arrows: true, 44 advance: 2, 45 startposition: "right", 46 showcaptions: true, 47 linkslides: true, 48 thumbnails: true, 49 contain: true, 50 playIcon: "PLAY", 51 pauseIcon: "PAUSE", 52 nextIcon: "NEXT", 53 prevIcon: "PREV", 54 tag: "figure" 55}; 56 57const SuperCoolGallery = props => ( 58 <Gallery 59 {...props} 60 settings={settings} 61 images={images} 62 /> 63)
see ./examples/umdLightbox.html
1<div id="react-gallery"></div> 2<script> 3 var ids = [ 4 15, 5 20, 6 25, 7 30, 8 35, 9 40, 10 45, 11 50, 12 55, 13 60, 14 65, 15 70, 16 75, 17 80, 18 85, 19 90, 20 95, 21 125, 22 130, 23 135, 24 140, 25 145, 26 150, 27 155, 28 160, 29 165, 30 170, 31 175, 32 180, 33 190, 34 195, 35 200 36 ]; 37 38 var imgs = ids.map(function(id, i) { 39 return { 40 src: `/imgs/IMG_${id}-1900.jpg`, 41 placeholder: `/imgs/IMG_${id}-100.jpg`, 42 srcset: `/imgs/IMG_${id}-1900.jpg 1900w, 43 /imgs/IMG_${id}-1200.jpg 1200w, 44 /imgs/IMG_${id}-768.jpg 768w, 45 /imgs/IMG_${id}-480.jpg 480w, 46 /imgs/IMG_${id}-300.jpg 300w`, 47 sizes: `(max-width: 320px) 320w, 48 (max-width: 480px) 480w, 49 (max-width: 768px) 768w, 50 (max-width: 1200px) 1200w, 51 1900px` 52 } 53 }); 54 55 var settings = { 56 lightbox: true 57 }; 58 59 return __RGD({ 60 images: imgs, 61 settings: settings, 62 style: { 63 width: "600px", 64 maxWidth: "95%", 65 margin: "0 auto" 66 }, 67 domId: "react-gallery" 68 }) 69 70</script>
To test the options, git clone this repo, put some images in the 'imgs' directory, or grab them from whatever remote resource, and set-up your configuration. Then run yarn start ./relative/path/from/src/to/configuration
or npm run start ./relative/path/from/src/to/configuration
.
There are examples provided. To run them locally, execute yarn start ../examples/gallery-example
or npm run start ../examples/gallery-example
.
Thanks to my lovely wife Norah @ Fox & Folk for the images for the examples.
clone, install, tinker, submit pr. Thanks!
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/18 approved changesets -- 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
64 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-10
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