# @wpmudev/react-pagination

> WPMU DEV Shared UI React Pagination Component

Latest version **1.1.6** (published 2023-06-06) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @wpmudev/react-pagination
pnpm add @wpmudev/react-pagination
yarn add @wpmudev/react-pagination
bun add @wpmudev/react-pagination
```

## 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.1.6 |
| Published | 2023-06-06 |
| First published | 2021-06-18 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 79.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | WPMU DEV |
| Maintainers | incsub-development, rtbfreitas |

## Links

- npm: https://www.npmjs.com/package/@wpmudev/react-pagination
- Repository: https://github.com/wpmudev/shared-ui-react
- Homepage: https://github.com/wpmudev/shared-ui-react#readme
- Issues: https://github.com/wpmudev/shared-ui-react/issues
- npm.io page: https://npm.io/package/@wpmudev/react-pagination

## Recent versions

- 1.1.6 (latest) — 2023-06-06
- 1.1.5 — 2023-06-05
- 1.1.4 — 2023-01-18
- 1.1.3 — 2022-11-16
- 1.1.2 — 2022-05-30
- 1.1.1 — 2022-05-03
- 1.1.0 — 2021-06-30
- 1.0.0 — 2021-06-18

## README

[![License: GPLv3](https://img.shields.io/badge/License-GPL%20v3-blue.svg?color=green)](http://www.gnu.org/licenses/gpl-3.0)
[![npm](https://img.shields.io/npm/v/@wpmudev/react-pagination)](https://www.npmjs.com/package/@wpmudev/react-pagination)
![npm peer dependency version](https://img.shields.io/npm/dependency-version/@wpmudev/react-pagination/peer/react)

# React Pagination

[React Pagination](https://wpmudev.github.io/shared-ui-react/?path=/story/components-pagination--primary) allows you include to paginate your long-list items on your project.

```
npm i @wpmudev/react-pagination --save-dev
```

## Usage

### Javascript Instantiation

```js
import React from "react";

import { Pagination } from "@wpmudev/react-pagination";

const MyApp = () => {

	//This is a prop that has to be passed to Pagination if we want a custom pagination.
	const paginationContent = ({ ...properties }) => { 
	/*You might wonder why *properties* instead of props. It is to make sure that the props which you might already be using in your component or file does not effect the ones that we want to use for the pagination.
	For that reason, it is highly recommended to use properties and append any other props that you might want to use inside the paginationContent.
	properties have all the required values for pagination.*/
		return (
			<>
				{PaginationNav({ ...properties })}
				{PaginationResults({ ...properties })}
				<div>Belllaaaa</div>
			</>
		);
	};

	return (
		<Pagination
			limit={5}
			results={true}
			skip={true}
			pagesToBottom={false} //This does not make any difference when using *paginationContent*.
			skipToFirstLabel=""
			previousLabel=""
			nextLabel=""
			skipToLastLabel=""
			child={childrenArray}
			paginationContent
		>
			<div>Element 1 could be here</div>
			<div>Element 2 could be here</div>
			<div>Element 3 could be here</div>
		</Pagination>
	);
};


```

### Props

| Prop Name | Type    | Description                               |
| --------- | ------- | ----------------------------------------- |
| limit     | Integer | Enter the elements limit per page.        |
| results   | Boolean | Shows results section if `true`.          |
| skip      | Boolean | Shows skip arrow buttons if `true`.       |
| pagesToBottom | Boolean | Pages will be rendered at bottom if true |
| skipToFirstLabel | String | String to be passed which will act as a label for skip to first button |
| previousLabel | String | String to be passed which will act as a label for next page button |
| nextLabel | String | String to be passed which will act as a label for previous page button |
| skipToLastLabel | String | String to be passed which will act as a label for skip to last button |
| child     | Array   | Pass an array here to render as elements. |
| paginationContent | component | Pass a component here to be rendered custom. |

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