# react-datatable-pagination

> A ReactJS component to render a Data-table with Pagination.

Latest version **1.0.3** (published 2019-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-datatable-pagination
pnpm add react-datatable-pagination
yarn add react-datatable-pagination
bun add react-datatable-pagination
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-05-25 |
| First published | 2019-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 36.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | shash95 |
| Maintainers | shash95 |
| Keywords | React, data-table, Pagination, CSV file |

## Links

- npm: https://www.npmjs.com/package/react-datatable-pagination
- Repository: https://github.com/Shashank-95/react-datatable-pagination
- Homepage: https://github.com/Shashank-95/react-datatable-pagination#readme
- Issues: https://github.com/Shashank-95/react-datatable-pagination/issues
- npm.io page: https://npm.io/package/react-datatable-pagination

## Dependencies (5)

- [react](https://npm.io/package/react.md) ^16.8.6
- [webpack](https://npm.io/package/webpack.md) ^4.31.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.8.6
- [url-loader](https://npm.io/package/url-loader.md) ^1.1.2
- [file-loader](https://npm.io/package/file-loader.md) ^3.0.1

## 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

- 1.0.3 (latest) — 2019-05-25
- 1.0.2 — 2019-05-24
- 1.0.1 — 2019-05-24
- 1.0.0 — 2019-05-22

## README

# react-datatable-pagination

**A ReactJS component to render a Data-table with Pagination.**

By installing this component you can render a customized data-table just by passing an array of objects. The component is complemented with additional features - Pagination and Export as CSV. 

![datatable](https://github.allstate.com/storage/user/6583/files/dd74c400-7e3e-11e9-859b-8dcdd06f0295)

## Installation

Install `react-datatable-pagination` with [npm](https://www.npmjs.com/):

```
$ npm install react-datatable-pagination --save
```
## Usage

Very easy to use. Just provide props with an array of objects by adding the content to be displayed in the data-table and a number which tells how many records needs to be displayed in one page.

**Note: Construct the array such that the key in each object should be the column name and value should be the corresponding data of that column.**

```js
import React, {Component} from 'react';
import ReactDOM from "react-dom";
import ReactDataTablePagination from 'react-datatable-pagination'


class App extends Component() {
    
    render(){
        const arrayOfObjects =  [
           {
                "Name": 'Jon Snow',
                "Position": 'Lord Commander',
                "Office": 'Castle Black',
                "Age": '28',
                "Date": '2011/04/25',
                "Skill": 'Knows Nothing'
                },
                {
                "Name": 'Bran, The Broken',
                "Position": 'King of 6 kingdoms',
                "Office": 'Capital',
                "Age": '18',
                "Date": '2011/07/25',
                "Skill": 'Knows Everything'
                }
        ];
    return (
            <div>     
                <ReactDataTablePagination arrayOfObjects={arrayOfObjects} dataInOnePage={5}/>
            </div>
        );
    }
}

ReactDOM.render(<App />, document.getElementById("root"));
```


## Props

Name | Type  | Description
--- | --- |  --- |
`arrayOfObjects` | array | **Required.** Content to be displayed in the data-table
`dataInOnePage` | Number | **Required.** The number of records displayed in one page
                     

## Contribute

1. [Submit an issue](https://github.com/Shashank-95/react-datatable-pagination/)
2. Fork the repository
3. Create a dedicated branch (never ever work in `master`)
4. The first time, run command: `webpack` into the directory
5. Run `npm start`
6. Fix bugs or implement features

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