0.0.6 • Published 5 years ago

react-photos-grid v0.0.6

Weekly downloads
3
License
Apache 2.0
Repository
github
Last release
5 years ago

react-photos-grid

Justified photos grid react component

NPM JavaScript Style Guide Build Status

Demo

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

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

1.0.0

5 years ago