0.4.0 • Published 10 years ago

react-adaptive-grid v0.4.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

React Adaptive Grid Build Status

Installation

npm install --save react-adaptive-grid

Features

  • windowing - render only visible items
  • relative positioning - all items position relative each other
  • scale items in proportion

Usage

import Grid from 'react-adaptive-grid'

// Regular array or Immutable.js List
const items = List([
    Map({id:1, foo: 'bar', width: 200, height: 300}),
    ...
])

// Your component must accept 'data' prop.
const ItemComponent = ({data, width, height, additionalHeight}) => (
    ...
)

const props = {
    ItemComponent,
    items,
    minWidth: 200
}

...
<Grid {...props}/>

Infinite scroll

const props = {
    ItemComponent,
    items,
    minWidth,
    load: () => ( /* load more items */ ),
    more: Boolean, // has more
    loading: Boolean
}

<Grid {...props} />

Example

Watch here

License

MIT

0.4.0

10 years ago

0.3.3

10 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago