1.8.3 • Published 5 years ago

react-picture-gallery v1.8.3

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Live example here

altText

GitHub


Examples

const pictures = [
  {
    src: "https://media.tenor.com/images/916c85aa24280f510de1e985ad718267/tenor.gif",         // string
    thumbnail: "https://media.tenor.com/images/916c85aa24280f510de1e985ad718267/tenor.gif",   // string
    title: "Border Collie",           // string or number
    alt: "l0l @ this p00ch!",         // string or number
    description: "Doggy dog",         // string or number
    timestamp: 'july 4, 1776',        // valid date - will be converted using new Date()
    height: '100px',                  // string - any valid CSS
    width: '100px',                   // string - any valid CSS
    tags: ['funny', 'humor', 'l0l'],  // array of strings or numbers
    ...anyOtherValues                 // all values will be returned when using onClick()
  }
];
const handleClick = picture => console.log(picture);
<Gallery
  galleryStyle={galleryStyle}
  pictureMargin="10px"
  pictures={pictures}
  onClick={handleClick}
  tagSearch
  titleSearch
  dateRange
  picturesPerPage={[10, 25, 50, 100]}
/>

Pictures Options

KeyTypeRequiredOptions/Action
srcStringNoAny valid link to a picture
thumbnailStringYesAny valid link to a picture
titleStringNoRequired when titleSearch is enabled
altStringNo
descriptionStringNo
timestampDateNoRequired when dateRange is enabled
heightCSSNoAny valid CSS value for height (default is 150px)
widthCSSNoAny valid CSS value for width (default is 150px)
tagsArrayNoArray of Strings (required when tagSearch is enabled)

Gallery Options

KeyTypeRequiredOptions/Action
galleryStyleJSX CSSNoAny valid JSX CSS for the gallery
pictureMarginCSSNoAny valid CSS value for margin
picturesObjectYesPictures to be displayed
onClickFunctionNoFunction will receive all values of selected picture object
tagSearchBooleanNoEnable/disable tag searching functionality
titleSearchBooleanNoEnable/disable title searching functionality
dateRangeBooleanNoEnable/disable date range filtering functionality
picturesPerPageArrayNoArray of numbers (default is [5, 10, 25, 50])

Notes:

  • anyOtherValues can be an object of any values that would be needed for the handleClick function
1.8.3

5 years ago

1.8.2

5 years ago

1.8.1

5 years ago

1.8.0

5 years ago

1.7.1

5 years ago

1.6.17

5 years ago

1.6.16

5 years ago

1.6.15

5 years ago

1.6.14

5 years ago

1.6.13

5 years ago

1.6.12

5 years ago

1.6.11

5 years ago

1.6.10

5 years ago

1.6.9

5 years ago

1.6.8

5 years ago

1.6.7

5 years ago

1.6.6

5 years ago

1.6.5

5 years ago

1.6.4

5 years ago

1.6.3

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.11

5 years ago

1.5.10

5 years ago

1.5.9

5 years ago

1.5.8

5 years ago

1.5.7

5 years ago

1.5.6

5 years ago

1.5.5

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.7

5 years ago

1.3.6

5 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago