react-photos-grid
v0.0.6
Published
Justified photos grid react component
Downloads
1
Readme
react-photos-grid
Justified photos grid react component
Install
npm install --save react-photos-grid
Usage
import * as React from 'react'
import PhotoGrid from 'react-photos-grid'
class Example extends React.Component {
const photos = new Array(50).fill(undefined).map(() => {
const width = Math.floor(Math.random() * (500 - 300)) + 300
const ratio = Math.floor(Math.random() * (1.8 - 0.5)) + 0.5
const height = Math.floor(width * ratio)
return {
src: 'https://picsum.photos/' + width + '/' + height,
width: width,
height: height,
}
})
return (
<PhotoGrid photos={photos} optimalHeight={400} ImageComponent={this.component}/>
)
}
}
License
Apache 2.0 © walkes