react-simple-paginator
v2.0.3
Published
react paginator, easy to use. Example in story book
Downloads
8
Maintainers
Readme
install
npm install react-simple-paginator
easy to use
import React from 'react';
import Paginator from 'react-simple-paginator';
export const Basic = () => {
const totalPage = 10;
const [currentPage, setCurrentPage] = useState(1);
useEffect(()=>{
// fetch data and update your page data source here
},[currentPage])
return (
<>
<h2>show content for page {currentPage}</h2>
<Paginator
totalPageNumber={totalPage}
currentPageNumber={currentPage}
onPageNavigation={(page) => () => {
setCurrentPage(page);
}}
/>
</>
);
};
see this