项目作者: komarovalexander

项目描述 :
Lightweight MIT React Table component with Sorting, Filtering, Grouping, Virtualization, Editing and many more
高级语言: TypeScript
项目地址: git://github.com/komarovalexander/ka-table.git
创建时间: 2019-09-25T18:21:49Z
项目社区:https://github.com/komarovalexander/ka-table

开源协议:MIT License

下载


The customizable, extendable, lightweight, and fully free React Table Component

GitHub license
npm version
Coverage Status

Site | Demos | Docs

Table
Demo link

Installation

npm

  1. npm install ka-table

yarn

  1. yarn add ka-table

Usage

Basic example

  1. import 'ka-table/style.css';
  2. import React from 'react';
  3. import { Table } from 'ka-table';
  4. import { DataType, EditingMode, SortingMode } from 'ka-table/enums';
  5. const dataArray = Array(10)
  6. .fill(undefined)
  7. .map((_, index) => ({
  8. column1: `column:1 row:${index}`,
  9. column2: `column:2 row:${index}`,
  10. column3: `column:3 row:${index}`,
  11. column4: `column:4 row:${index}`,
  12. id: index,
  13. }));
  14. const OverviewDemo = () => {
  15. return (
  16. <Table
  17. columns={[
  18. { key: 'column1', title: 'Column 1', dataType: DataType.String },
  19. { key: 'column2', title: 'Column 2', dataType: DataType.String },
  20. { key: 'column3', title: 'Column 3', dataType: DataType.String },
  21. { key: 'column4', title: 'Column 4', dataType: DataType.String },
  22. ]}
  23. data={dataArray}
  24. editingMode={EditingMode.Cell}
  25. rowKeyField={'id'}
  26. sortingMode={SortingMode.Single}
  27. ></Table>
  28. );
  29. };
  30. export default OverviewDemo;

Example link