Gathering detailed insights and metrics for react-use-paginator
Gathering detailed insights and metrics for react-use-paginator
Gathering detailed insights and metrics for react-use-paginator
Gathering detailed insights and metrics for react-use-paginator
react-js-pagination
Simple, easy to use component for pagination. Compatible with bootstrap paginator stylesheets
@careerday-jobs/react-paginator
Simple and easy-to-use pagination library for React
react-simple-paginator
react paginator, easy to use. Example in story book
up-use-paginator
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
A simple yet configurable react hook for pagination. Functionally developed.
npm install react-use-paginator
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (66.08%)
CSS (20.93%)
HTML (12.99%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
3 Stars
46 Commits
1 Watchers
17 Branches
2 Contributors
Updated on Jun 21, 2022
Latest Version
1.3.2
Package Id
react-use-paginator@1.3.2
Unpacked Size
24.26 kB
Size
5.63 kB
File Count
7
NPM Version
6.14.11
Node Version
14.16.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
19
A simple yet configurable react hook for pagination. No dependencies. Functionally developed.
usePaginator
allows the rapid development of paginated views that are light and performant. Just as easy as it is to get started, there are also plenty of customization options should you require them.
Handful of usage demos can be found on the usage guide.
1npm install --save react-use-paginator
1import React from 'react'; 2import usePaginator from 'react-use-paginator'; 3 4const Page = ({ items, index }) => { 5 return ( 6 <div> 7 <div>This is page {index}</div> 8 <div>It contains the following items:</div> 9 {items.map((item) => ( 10 <div>{item}</div> 11 ))} 12 </div> 13 ); 14}; 15 16const App = () => { 17 const data = ['Foo1', 'Bar1', 'Foo2', 'Bar2', 'Foo3', 'Bar3', 'Foo4', 'Bar4']; 18 const { Component, nextPage, prevPage } = usePaginator({ 19 PageComponent: Page, 20 maxPerPage: 5, 21 data, 22 }); 23 24 return ( 25 <div> 26 <Button onClick={prevPage}>Prev</Button> 27 <Button onClick={nextPage}>Next</Button> 28 <Component /> 29 </div> 30 ); 31};
1const input = {...} 2const output = usePaginator(input)
Option | Type | Description |
---|---|---|
PageComponent | Functional component with signature: (props) => <div/> | A react component to be used in rendering specific page contents. Component will receive index and items as input props in addition to any props you specify when rendering the output Component |
data | Array | Input data that needs to be paginated. The hook will split the data into items per page made available to the PageComponent |
maxPerPage | Number | Default: 25 . Optional to be set. Will split the input data into as many pages as there is data. Ex: 80 items in data would have 4 total pages to render. 3 pages of 25 items and a last page of 5 items |
The output of the hook is an array of values to use in order to render your component exactly how you need it.
1const { ...output } = usePaginator(input);
Option | Type | Description |
---|---|---|
currentPage | Number | The current page index being shown. Starts at 1 . |
Component | React Component | This is the input PageComponent with a specific page's items made available through props. Simply render with <Component /> anywhere on your page. |
hasNextPage | Boolean | Either true or false depending if there is another page to render |
onNextPage Alias: nextPage | Function signature () => {...} | Set the page index directly to the next page. A shortcut to prop into most buttons simply with onClick={nextPage} . This function will automatically roll around to page 1 when called on the last page of results. |
onPrevPage Alias: prevPage | Function signature () => {...} | Set the page index directly to the previous page. A shortcut to prop into most buttons simply with onClick={prevPage} . This function will automatically roll around to the last page when called on the first page of results. |
pageItems | Array | The items from the input data currently being rendered |
setPageIndex | Function signature (index) => {...} | Set the page index directly for use cases where you need to traverse directly to certain pages. This "index" value starts at 1 because all pages do as well. No numbers less than 1 are acceptable |
totalPages | Number | The total number of pages. Essentially this is the ceiling integer value of: data.length / maxPerPage . But why calculate that yourself when the hook has it available already? |
MIT © albchu🍍
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 1/11 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
102 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More