react-unsplash-grid-gallery
v1.0.1
Published
A unsplash like gallery grid in react.
Downloads
2
Readme
react-unsplash-gallery-grid
A grid to recreate the unsplash like gallery in react. This project is a rewrite of unsplash-gallery project to port it in a configureable component.
Installation
Install from npm:
npm install react-unsplash-grid-gallery
Usage
import UnsplashGallery from 'react-unsplash-grid-gallery';
// rest of code omitted for the sake of this example
// ...
const images = [
{height: 500, width: 300, src: 'http://example.com/img1.jpg'},
{height: 200, width: 400, src: 'http://example.com/img2.jpg'},
{height: 350, width: 600, src: 'http://example.com/img3.jpg'},
]
<UnsplashGalllery images={images} columns={3} />
// ...
API
images
Type: Array<{width, height, src}>
Required: true
columns
Type: number
Required: false
Default: 2
The number of columns to render images into.
License
MIT © Made with <3 & :coffee: by Hamza Baig