1.0.3 • Published 5 years ago

react-gallery-component v1.0.3

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

react-gallery-component

A light image gallery component for React app

Setup

  • npm install react-gallery-component
import GalleryComponent from 'react-gallery-component';

const images = [
    'img_url_1',
    'img_url_2',
    'img_url_3',
    'img_url_4'
];

class App extends React.Component {
  render() {
    return <GalleryComponent imageCollection={images} />;
  }
}

Props

PropertyTypeRequiredDefaultDescription
imageCollectionarray:white_check_mark:An array of image URL for the image gallery
backgroundColorstringgreyImage container background color when image is not filling the whole container
imageFillbooleanfalseImage is scaled to maintain its aspect ratio or sized to filling the entire image container
infinitebooleanfalseInfinite sliding
slideTimenumber (ms)500Sliding time between each image
// imageCollection example
[
    'img_url_1',
    'img_url_2',
    'img_url_3',
    'img_url_4'
]

Maintainers

License

MIT License