Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Latest commit

 

History

History
41 lines (32 loc) · 928 Bytes

README.md

File metadata and controls

41 lines (32 loc) · 928 Bytes

react-native-grid-view

This component allows to display a grid/collection of items with more than one item per row. The items per row is configurable and it uses a 'ListView' in order to have a proper recycle mechanism.

Image of react-grid-view

Getting started

  1. npm install react-native-grid-view

Example

All you need is to require the react-native-grid-view module and then use the <GridView/> tag.

var React = require('react-native');
var {
  AppRegistry,
  StyleSheet,
  View
} = React;
var GridView = require('react-native-grid-view');

var myApp = React.createClass({
  render: function() {
    return (
      <GridView
        items={this.state.movies}
        itemsPerRow={3}
        renderItem={this.renderItem}
      />
    );
  },
  renderItem: function(item) {
    return <Movie movie={item} />
  },
});

AppRegistry.registerComponent('myApp', () => myApp);