redux-devtools-grid-monitor

0.16.3 • Public • Published

gridiron

Lightweight grid framework built on top of react-virtualized / fixed-data-table for easy highly customizable grids generated from redux state.

Build Status codecov

NPM

Install

npm i -S gridiron

Usage

UserGrid.js

import React from 'react'
import { connect } from 'react-redux'
import ReactVirtualized from 'react-virtualized'
import { createGrid } from 'gridiron'
 
const { Grid } = createGrid({ React, connect, ReactVirtualized })
 
/** Create a grid to show users first name, last name, and age from redux */
export default props => (
  <Grid
    mapCols={
      /** Map redux state to object with column name keys and header component values */
      state => ({ first: <div>First Name</div>
                , last: <div>Last Name</div>
                , age: { render: <div>Age</div>, width: 100 }
                })
    }
    mapRows={
      /** Map redux state to grid rows. */
      state => state.users.map(x => [x.first, x.last, x.age])
    }
  />
)

Test

See gridiron's test project at gridiron-test

In active development, come back in a few days.

Readme

Keywords

Package Sidebar

Install

npm i redux-devtools-grid-monitor

Weekly Downloads

14

Version

0.16.3

License

MIT

Last publish

Collaborators

  • cchamberlain