1.1.0 • Published 5 years ago

efficient-react-table v1.1.0

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

efficient-react-table

npm package

A simple data table inspired by react-table. The package "react-table" does not do efficient rendering of rows and cells. This package "efficient-react-table" offers the following features:

  1. Simpler and Faster
  2. Rows and Cells with same data do not re-render
  3. Rows can be grouped into continuous pages
  4. Rows can by stlyed according to their data
  5. A configurable subset of rows are loaded initially. Useful when table data is very large
  6. Infinite scrolling
  7. Supports multi-sorting

Example:

let columns = [
  {
    Header: "Id",
    accessor: "id",
    sortable:true
  },
  {
    Header: "Name",
    accessor: "name",
    Cell: cellInfo => <input value={cellInfo.value} />
  },
  {
    Header: "Country",
    accessor: "country"
  },
  {
    Header: "Unit",
    accessor: "unit",
    show: false
  }
];

let data = [
   { id:101, name:"Alice",country:"USA",unit:"FMCG" },
   { id:102, name:"Bob",country:"UK",unit:"Retail" },
   { id:103, name:"Charles",country:"India",unit:"Auto" },
   { id:104, name:"Dave",country:"UK",unit:"Retail" },
   { id:105, name:"Emily",country:"USA",unit:"BFSI" }
]
 <EfficientReactTable
    columnDefinitions={this.state.columns}
    pageSize={4}
    thresholdPageCount={3}
    data={this.state.data}          
    rowStyler={row => {
      if (row["id"] === 102) return { backgroundColor: "red" };
    }}
/>

Extremely basic version, new features to follow

1.1.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago