1.1.1 • Published 5 years ago

react-thumb-photo-gallery v1.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

React-Photo-Gallery

npm version

react-thumb-photo-gallery solve two problems: 1. first display image thumbs

screenshoot

  1. view original picture after click the thumb image

screenshoot

Online Demo

Edit react-thumb-photo-gallery-demo

Usage

  1. PhotoGallery
import PhotoGallery from 'react-thumb-photo-gallery'

<PhotoGallery photos={photos} margin={6} radius={4} />
  1. PhotoThumbs
import { PhotoThumbs } from 'react-thumb-photo-gallery'

<PhotoThumbs photos={photos} margin={6} radius={4} />

PhotoThumbs only handle thumbs without photoswipe integration, so it has smaller package size.

What this package did

PhotoViewer is based on photoswipe. First is solve image original size, photoswipe only works with correct width and height of images. Unfortunately, we always don't have the image original size.

Second is layout style, thumb have margin between others, and there wrapper cannot take more space.

Components

1. PhotoGallery/PhotoThumbs

Props

Prop NameTypeDefaultDescription
photosArraystring[]Image data set
sizeNumber64Thumbnail image size
widthNumberundefinedThumbnail image width
heightNumberundefinedThumbnail image height
direction'row' | 'column''row'Thumbnail Direction
marginNumberundefinedThumbnail margin
srcPrefixStringundefinedAdd prefix string for each photo src
imagePlaceholderStringundefineddefault image for gallery item
itemClassStringundefinedadd class for gallery item
radiusStringundefinedquick set image border-radius, such as 4 or '4px'
expandAnimatebooleanundefinedonly for PhotoGallery, make preview animation start from thumb position

2. PhotoViewer

PhotoViewer is just the wrapper of photoswip for react

import { PhotoViewer } from 'react-thumb-photo-gallery'

Props

Prop NameTypeDefaultDescription
itemsArray{src, w, h}undefinedImage data set
optionsObject{}Props reference photos props: Link
1.1.1

5 years ago

1.1.0

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago