matteoterrinoni / react-virtualized-table

React virtualized table
MIT License
8 stars 0 forks source link
react-virtualized table typescript virtualized

React Virtualized Table

Demo here!

Stackblitz example here

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}/>