Skip to main content

Paginations 🆕

simple pagination​

const Pagination = () => {
const [currentPage, setCurrentPage] = useState(1);
const totalPages = 5; // Replace with your total number of pages

const handlePageChange = (page) => {
setCurrentPage(page);
};
return (
<Paginating
totalPages={totalPages}
currentPage={currentPage}
onPageChange={handlePageChange}
pageTextStyle={{ color: "red", fontSize: 10 }}
currentPageButtonColor="green"
/>
);
};

export default Pagination;

Api References for simplepagination

ParameterTypeDescription
totalPages numbertotal number of your pages
currentPagestringcurrent page number
borderColorstringborderColor for pagination
paginationColorstringpagination background color
currentPageButtonColorstringcurrent pagination color
pageTextStylestyleViewyour custom styles

ellipse pagination​

const EllipsePagination = () => {
const [currentPage, setCurrentPage] = useState < number > 1;
const totalPages: number = 100; // Replace with your total number of pages

const handlePageChange = (page: number): void => {
setCurrentPage(page);
};

return (
<EllipsePagination
totalPages={totalPages}
currentPage={currentPage}
onPageChange={handlePageChange}
pageRangeDisplayed={5} // Optional: Adjust the number of pages displayed
/>
);
};

export default EllipsePagination;

Api References for EllipsePagination

​

ParameterTypeDescription
totalPages numbertotal number of your pages
currentPagestringcurrent page number
onPageChangevoidon page change function
borderColorstringborderColor for pagination
paginationColorstringpagination background color
currentPageButtonColorstringcurrent pagination color
pageTextStylestyleViewyour custom styles

Button pagination​

const ButtonPagination = () => {
const [currentPage, setCurrentPage] = useState(1);
const totalPages = 10; // Total number of pages (adjust as needed)

const handleNextPage = (page) => {
setCurrentPage(page);
};

const handlePrevPage = (page) => {
setCurrentPage(page);
};

return (
<ButtonPagination
totalPages={totalPages}
currentPage={currentPage}
onPageChange={handlePageChange}
pageRangeDisplayed={5} // Optional: Adjust the number of pages displayed
/>
);
};

export default ButtonPagination;

Api References for ButtonPagination

​

ParameterTypeDescription
totalPages numbertotal number of your pages
currentPagestringcurrent page number
onPageChangevoidon page change function
borderColorstringborderColor for pagination
paginationColorstringpagination background color
currentPageButtonColorstringcurrent pagination color
pageTextStylestyleViewyour custom styles
onNextPagevoidfunction fo next page action
onPrevPagevoidfunction fo Previous page action
prevStylestyleViewPrevious button style
nextStylestyleViewnext button style
PrevTextStylestyleViewPrevious text in side button or item style
NextTextStylestyleViewnext text in side button or item style
prevTextstringtext inside prev button
nextTextstringtext in side next button