# sortable-table-react

> A simple react component that returns a sortable table

Latest version **1.0.3** (published 2023-10-03) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-10-03 |
| First published | 2023-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 556.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Timothe Gonin |
| Maintainers | timothegonin |

## Links

- npm: https://www.npmjs.com/package/sortable-table-react
- npm.io page: https://npm.io/package/sortable-table-react

## Dependencies (2)

- [bootstrap](https://npm.io/package/bootstrap.md) ^5.3.1
- [react-bootstrap](https://npm.io/package/react-bootstrap.md) ^2.8.0

## Recent versions

- 1.0.3 (latest) — 2023-10-03
- 1.0.2 — 2023-09-15
- 1.0.1 — 2023-09-13
- 1.0.0 — 2023-09-07

## README

# Sortable-table-react

A React component for displaying a sortable and pageable table with controls

![JavaScript](https://img.shields.io/badge/Language-JavaScript-f7df1e)
![React](https://img.shields.io/badge/Framework-React-5ed3f3)

### Features description :

- Sort the table columns.
- Select the number of data to display (interacts with pagination).
- Filter table data via the search bar.
- Dynamically display the number of entries shown in the table.
- Paginate the data displayed in the table.

---

---

## Prerequisites

**NodeJS :** (v16.15.0 or later)
**Npm :** (v7.24.0 or later) / **Yarn :** (v1.22.18 or later)

---

---

## Installation

Install with NPM

```bash
npm install sortable-table-react
```

Install with YARN

```bash
yarn add sortable-table-react
```

---

---

## Usage/Examples

```javascript
import { SortableTable } from "sortable-table-react";

const tableHeads = [
	"First Name",
	"Last Name",
	"Start Date",
	"Department",
	"Date of Birth",
	"Street",
	"City",
	"State",
	"Zip Code",
];

const data = [
	{
		id: 1,
		firstName: "Deirdre",
		lastName: "Blackaller",
		department: "Human Resources",
		startDate: "08/27/2008",
		dateOfBirth: "11/27/1978",
		street: "16 Cottonwood Junction",
		city: "Alpharetta",
		state: "Georgia",
		zipCode: "30022",
	},
];

const App = () => {
	return <SortableTable data={data} tableHeads={tableHeads} />;
};

export default App;
```

#### - Props

| Name       | Type                            | Description                  |
| ---------- | ------------------------------- | ---------------------------- |
| data       | **Required** - array of objects | Data to display in the table |
| tableHeads | **Required** - array of string  | List of table headers        |

---

---

## License

[MIT](https://choosealicense.com/licenses/mit/)

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