Skip to content

matteoterrinoni/react-virtualized-table

Repository files navigation

React Virtualized Table

styled with prettier Greenkeeper badge Build Status Coverage Status Dev Dependencies Donate

A simple table using react-virtualized.

Usage

npm install
import {
	FilteredVTable,
	GivenVTable
} from 'react-virtualized-table'

import * as faker from 'faker'

export const initFakeItems = (n = 1000) => {
  let list = []
  for (let i = 0; i < n; i++) {
    list.push({
      name: faker.name.findName(),
      email: faker.internet.email(),
      age: faker.random.number()
    })
  }
  return list
}

const columns = GivenVTable.columns()
.addSortableColumnFor('name')
.addColumnFor('age')
.addSortableColumnFor('email')
.result

<FilteredVTable
items={initFakeItems()}
columns={columns}/>