# paginator-kasamoke

> This library is built to make pagination thing easy. Just add some state variables and import couple of functions and you are ready to go.

Latest version **1.0.4** (published 2022-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install paginator-kasamoke
pnpm add paginator-kasamoke
yarn add paginator-kasamoke
bun add paginator-kasamoke
```

## 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.4 |
| Published | 2022-10-09 |
| First published | 2022-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Niraj |
| Maintainers | niraj034 |
| Keywords | Pagination |

## Links

- npm: https://www.npmjs.com/package/paginator-kasamoke
- Repository: https://github.com/nirajpandey034/paginator-kasamoke
- Homepage: https://github.com/nirajpandey034/paginator-kasamoke#readme
- Issues: https://github.com/nirajpandey034/paginator-kasamoke/issues
- npm.io page: https://npm.io/package/paginator-kasamoke

## Dependencies (1)

- [webpack](https://npm.io/package/webpack.md) ^5.74.0

## Recent versions

- 1.0.4 (latest) — 2022-10-09
- 1.0.3 — 2022-10-09
- 1.0.2 — 2022-10-09
- 1.0.1 — 2022-10-09
- 1.0.0 — 2022-10-09

## README

# User guide

This library is built to make pagination thing easy.
Just add some state variables and import couple of functions and you are ready to go.

# Code samples:

# Step 1:

# Add these states

data to be shown(Can be anything, we need only array)

```
const [data, setData] = useState([]);
```

page number (you can declare as it is)

```
const [currentPageNumber, setCurrentPageNumber] = useState(1);
```

starting index (you can declare as it is)

```
const [currentPageIndex, setCurrentPageIndex] = useState(0);
```

total number of data's (count of data or you can say, length of input array)

```
const [totalDataCount, setTotalDataCount] = useState(0);

```

limit, or ending index

```
const [dataPerPage, setDataPerPage] = useState(10);
```


# Step 2:

# While mapping through your data, pass your data array through dataFormatter():

```
dataFormatter(data, currentPageIndex, dataPerPage, currentPageNumber).map((post) .....
```

# Step 3:

# Call the Pagination component as following

```
<Pagination
currentPage={currentPageNumber}
setCurrentPage={setCurrentPageNumber}
currentPageIndex={currentPageIndex}
setCurrentPageIndex={setCurrentPageIndex}
TotalDataCount={totalDataCount}
DataPerPage={dataPerPage}
/>
```

# Contact Us Section

# Contact for bug or improvements: (nirajpandey034@gmail.com)

# Github: https://github.com/nirajpandey034/Paginator

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