# react-sorted-table

> A simple sorted table component.

Latest version **0.0.2** (published 2019-01-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-sorted-table
pnpm add react-sorted-table
yarn add react-sorted-table
bun add react-sorted-table
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2019-01-11 |
| First published | 2019-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 44 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hissalht |
| Maintainers | hissalht |

## Links

- npm: https://www.npmjs.com/package/react-sorted-table
- Repository: https://github.com/hissalht/react-sorted-table
- npm.io page: https://npm.io/package/react-sorted-table

## Recent versions

- 0.0.2 (latest) — 2019-01-11
- 0.0.1 — 2019-01-11

## README

# sorted-table

> A simple sortable table component.

[![NPM](https://img.shields.io/npm/v/react-sorted-table.svg)](https://www.npmjs.com/package/react-sorted-table) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save react-sorted-table
# or
yarn add react-sorted-table
```

## Usage

```jsx
import React from 'react'
import SortedTable from 'react-sorted-table'
import moment from 'moment'

const columns = [
  { id: 'name', label: 'Name', accessor: 'name' },
  { id: 'date', label: 'Date', accessor: item => moment(item.date).format('YYYY/MM/DD') },
  { id: 'quantity', label: 'Quantity', accessor: 'quantity' },
  { id: 'reference', label: 'Reference', accessor: 'reference' },
]

const data = [
  { _id: '0001', name: 'tomato', date: new Date(), quantity: 55, reference: '#AF34' },
  // ...
]

const Example = () => (
  <div>
    <SortedTable columns={columns} data={data} keyAccessor='_id' />
  </div>
)
```

## License

MIT © [hissalht](https://github.com/hissalht)

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