Gathering detailed insights and metrics for react-custom-pagination
Gathering detailed insights and metrics for react-custom-pagination
Gathering detailed insights and metrics for react-custom-pagination
Gathering detailed insights and metrics for react-custom-pagination
react-custom-components-ui
React Custom Components
react-ellipsis-pagination
This is a custom Pagination basically Ellipsis type of Pagination, React custom Ellipsis pagination for handling multiple dat/items on same screen with different page having limited items per page.
react-native-custom-pagination
custom pagination for react native
custom-react-pagination
Custom Pagination Component built upon React JS
npm install react-custom-pagination
Typescript
Module System
Node Version
NPM Version
JavaScript (56.77%)
HTML (28.07%)
CSS (15.17%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
3 Stars
24 Commits
4 Forks
2 Watchers
1 Branches
1 Contributors
Updated on Aug 19, 2024
Latest Version
1.6.8
Package Id
react-custom-pagination@1.6.8
Unpacked Size
11.92 kB
Size
3.80 kB
File Count
3
NPM Version
8.8.0
Node Version
16.13.2
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
simple and responsive pagination for react.
1npm install --save react-custom-pagination
Get Responsive and yet simple pagination for React .
npm install react-custom-pagination --save
import Pagination from "react-custom-pagination";
//list of items you want to render
const posts=[
{ id: "1", name: "user1" },
{ id: "2", name: "user2" },
{ id: "3", name: "user3" },
{ id: "4", name: "user4" },
{ id: "5", name: "user5" },
{ id: "6", name: "user6" },
]
const [currentPage, setCurrentPage] = useState(1); //page
const [postsPerPage] = useState(5); // no of posts you want to render in one page
//get current Posts
const indexOfLastPost = currentPage * postsPerPage;
const indexOfFirstPost = indexOfLastPost - postsPerPage;
const currentPosts = posts.slice(indexOfFirstPost, indexOfLastPost);
// when user clicks on number this function will execute
const paginate = (number) => {
setCurrentPage(number);
};
//map current posts to render 5 posts per page
<Pagination
totalPosts={posts.length}
postsPerPage={postsPerPage}
paginate={paginate}
/>
import React, { useState } from "react";
import "./App.css";
import Pagination from "react-custom-pagination";
const App = () => {
const posts = [
{ id: "1", name: "user 1" },
{ id: "2", name: "user 2" },
{ id: "3", name: "user 3" },
{ id: "4", name: "user 4" },
{ id: "5", name: "user 5" },
{ id: "6", name: "user 6" },
{ id: "7", name: "user 7" },
{ id: "8", name: "user 8" },
{ id: "9", name: "user 9" },
{ id: "10", name: "user 10" },
{ id: "11", name: "user 11" },
{ id: "12", name: "user 12" },
{ id: "13", name: "user 13" },
{ id: "14", name: "user 14" },
{ id: "15", name: "user 15" },
{ id: "16", name: "user 16" },
{ id: "17", name: "user 17" },
{ id: "18", name: "user 18" },
{ id: "19", name: "user 19" },
{ id: "20", name: "user 20" },
];
const [currentPage, setCurrentPage] = useState(1);
const [postsPerPage] = useState(3);
//get current Posts
const indexOfLastPost = currentPage * postsPerPage;
const indexOfFirstPost = indexOfLastPost - postsPerPage;
const currentPosts = posts.slice(indexOfFirstPost, indexOfLastPost);
// when user clicks on number this function will execute
const paginate = (number) => {
setCurrentPage(number);
};
return (
<>
<div
style={{
width: "500px",
textAlign: "center",
marginTop: "50px",
height: "200px",
}}
>
<h1 style={{ textAlign: "center", color: "green" }}>
Pagination Example
</h1>
{currentPosts.map((item) => {
return (
<p key={item.id} style={{ color: "red" }}>
{item.name}
</p>
);
})}
</div>
<div style={{ width: "500px" }}>
<Pagination
totalPosts={posts.length}
postsPerPage={postsPerPage}
paginate={paginate}
view={5}
showLast={true}
showFirst={true}
showIndex={true}
/>
</div>
</>
);
};
export default App;
<Pagination
totalPosts={posts.length}
/>
<Pagination
postsPerPage={postsPerPage}
/>
// when user clicks on number this function will execute and change currentPage
//paginate function
const paginate = (number) => {
setCurrentPage(number);
};
//pagination component
<Pagination
paginate={paginate}
/>
Name | Required | Type | Default | Description |
---|---|---|---|---|
totalPosts | Yes | Number | --- | total no of posts |
postsPerPage | Yes | Number | --- | no of posts per page |
paginate | Yes | function | --- | this function will execute when click on paginate number |
view | No | Number | 5 | no of paginates |
showIndex | No | Boolean | false | shows the index bar |
showFirst | No | Boolean | false | shows the go to first page button |
showLast | No | Boolean | false | shows the go to Last page button |
showFirstText | No | String | "First Page" | text inside show first page button |
showLastText | No | String | "Last Page" | text inside show last page button |
color | No | String | "white" | color of the text |
bgColor | No | String | "skyblue" | background color |
indexbgColor | No | String | "tomato" | background color of index bar |
selectColor | No | String | "grey" | background color when selected |
boxHeight | No | String,Number | "40px" | height |
boxWidth | No | String,Number | "40px" | width |
boxRadius | No | String | "50%" | border-radius |
indexBorderRadius | No | String | "5%" | border-radius of index tab |
justify | No | String | "center" | justify-content |
//view
<Pagination
view={5} //no of paginates
/>
ISC © akhilv77
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
security policy file not detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
41 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