Skip to content

huyansheng3/rc-photo-grid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React photo-grid

Travis npm package Coveralls

A React component photo-grid like google search photo grid! inspired by the blog

demo

live demo

API

PhotoGrid props

name description type default
photos photo list Array[String] or Arrary[{url: String, width: Number, height: Number}] []
unit photo height unit Number 200

you can install by run npm i --save rc-photo-grid

example:

const cats = [
  {
    "url": "photo-103450229.jpg",
    "width": 675,
    "height": 900
  },
  {
    "url": "photo-108273877.jpg",
    "width": 1170,
    "height": 780
  },
  {
    "url": "photo-115203323.jpg",
    "width": 1170,
    "height": 780
  },
]

class Demo1 extends Component {
  render() {
    const photos = cats.map(
      cat => 'https://xieranmaya.github.io/images/cats/' + cat.url
    )
    return (
      <div>
        <h1>photo-grid Demo with url</h1>
        <PhotoGrid photos={photos} />
      </div>
    )
  }
}

Licensed

MIT

About

like the google search photo grid! just use css.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published