Image tiler is a React component that displays images in a responsive, tiled layout.
$ npm install react-image-tiler
The Tiler
component has the following properties:
images
- an array of image URLs to displayminWidth
- the minimum width of an imagemaxWidth
- the maximum width of an imageparentWidth
- a function returning the pixel width of a parent. By default, it'swindow.innerWidth
import React from 'react'
import ReactDOM from 'react-dom'
import Tiler from 'react-image-tiler'
images = [
'http://placekitten.com/300/300',
'http://placekitten.com/300/300',
'http://placekitten.com/300/300',
'http://placekitten.com/300/300',
]
ReactDOM.render(<Tiler images={images} minWidth="200" />, document.getElementById('foo'))
See example/index.html
.
The example also includes a very simple InstagramFeed
class that makes it easy to pull a public feed of images from someone's Instagram account. It's used in the example/index.jsx
example, and also on my website
$ npm run example