# @kavience/react-table

> a react table component: https://kavience.github.io/react-table/

Latest version **0.0.4** (published 2021-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kavience/react-table
pnpm add @kavience/react-table
yarn add @kavience/react-table
bun add @kavience/react-table
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2021-12-17 |
| First published | 2021-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 129.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | kavience |
| Maintainers | kavience_owner |
| Keywords | react, react-table, rc-select, rc-dropdown, rc-switch |

## Links

- npm: https://www.npmjs.com/package/@kavience/react-table
- Repository: https://github.com/kavience/react-table
- Issues: https://github.com/kavience/react-table/issues
- npm.io page: https://npm.io/package/@kavience/react-table

## Dependencies (10)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [rc-select](https://npm.io/package/rc-select.md) ^14.0.0-alpha.8
- [rc-switch](https://npm.io/package/rc-switch.md) ^3.2.2
- [react-dnd](https://npm.io/package/react-dnd.md) ^14.0.4
- [rc-checkbox](https://npm.io/package/rc-checkbox.md) ^2.3.2
- [rc-dropdown](https://npm.io/package/rc-dropdown.md) ^3.2.0
- [@types/lodash](https://npm.io/package/@types/lodash.md) ^4.14.178
- [rc-pagination](https://npm.io/package/rc-pagination.md) ^3.1.14
- [react-resizable](https://npm.io/package/react-resizable.md) ^3.0.4
- [react-dnd-html5-backend](https://npm.io/package/react-dnd-html5-backend.md) ^14.0.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2021-12-17
- 0.0.3 — 2021-12-16
- 0.0.2 — 2021-12-16
- 0.0.1 — 2021-12-16

## README

<h1 align="center">React Table Component</h1>

## Introduction
A react table UI component.

## Demo

[View Demo](https://kavience.github.io/react-table/)

## Usage

```
npm install @kavience/react-table
```

Easy use

```ts
import React from 'react';
import ReactTable from '@kavience/react-table';

const columns: any[] = [
  {
    title: '姓名',
    align: 'center',
    width: 120,
    ellipsis: true,
    dataIndex: 'name'
  },
  {
    title: '年龄',
    dataIndex: 'age'
  },
  {
    title: '身高',
    dataIndex: 'height'
  },
  {
    title: '体重',
    dataIndex: 'weight'
  }
];

const EasyUse = () => {
  const dataSource = [
    {
      id: 1,
      name:
        'kevinkevinkevinkevinkevikevinkevinkevinkevinkevinkevinkevinkevinkevinkevinn',
      age: 28,
      height: '168cm',
      weight: '75kg'
    },
    {
      id: 2,
      name: 'kevin2',
      age: 28,
      height: '168cm',
      weight: '75kg'
    },
    {
      id: 3,
      name: 'kevin3',
      age: 28,
      height: '168cm',
      weight: '75kg'
    }
  ];
  
  return (
    <div>
      <h2>Use React Table Simply</h2>
      <ReactTable
        size="mini"
        bordered
        rowKey="id"
        columns={columns}
        dataSource={dataSource}
      />
    </div>
  );
};

export default EasyUse;
```

## Api

### Table 
| Property   | Description        | Type                                                    | Default  | Version |
| :--------- | :----------------- | :------------------------------------------------------ | :------- | :------ |
| columns    | Table coulmns      | Column[]                                                | []       | 0.0.1   |
| dataSource | Table data source  | any[]                                                   | []       | 0.0.1   |
| bordered   | Show border or not | boolean                                                 | false    | 0.0.1   |
| rowKey     | Row's unique key   | string                                                  | 'key'    | 0.0.1   |
| size       | Table size         | 'mini'   \| 'small' \| 'middle' \| 'large'              | 'middle' | 0.0.1   |
| header     | Table header       | any                                                     |          | 0.0.1   |
| footer     | Table  footer      | any                                                     |          | 0.0.1   |
| pagination | Pagination         | PaginationProps                                         |          | 0.0.1   |
| locale     | Language locale    | ReactTableLocal                                         |          | 0.0.1   |
| onChange   | Table change       | (pagination?: any, filters?: any, sorter?: any) => any; |          | 0.0.1   |

### Column
| Property  | Description                                                                          | Type                                                       | Default | Version |
| :-------- | :----------------------------------------------------------------------------------- | :--------------------------------------------------------- | :------ | :------ |
| key       | Unique key of this column, you can ignore this prop if you've set a unique dataIndex | string                                                     |         | 0.0.1   |
| dataIndex | Display field of the data record                                                     | string                                                     |         | 0.0.1   |
| title     | Column title                                                                         | string                                                     |         | 0.0.1   |
| align     | The specify which way that column is aligned                                         | \'left' \| 'right' \| 'center'                             |         | 0.0.1   |
| width     | Table Width                                                                          | number  \| string                                          |         | 0.0.1   |
| ellipsis  | The ellipsis cell content, not working with sorter and filters for now.              | boolean                                                    | false   | 0.0.1   |
| hidden    | Hidden this column                                                                   | boolean                                                    | false   | 0.0.1   |
| className | Column class                                                                         | string                                                     |         | 0.0.1   |
| onFilter  | Column on filter                                                                     | (value: string, record: any) => boolean;                   |         | 0.0.1   |
| sorter    | Column Sorter                                                                        | ((firstRecord: any, secondRecord: any) => any) \| boolean; |         | 0.0.1   |


## Thanks

- rc-checkbox
- rc-dropdown
- rc-pagination
- rc-select
- rc-switch
- [willow-component-tools](https://github.com/kavience/willow-component-tool)

---
_Source: https://npm.io/package/@kavience/react-table · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
