Skip to content

nghiepdev/react-infinite-pagination

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-infinite-pagination

NPM version NPM monthly download

A React component to render a infinite pagination(without total page) just like google

By installing this component and using my example.css you can obtain this:

screenshot

Installation

yarn add react-infinite-pagination

Example: https://codesandbox.io/s/react-infinite-pagination-example-rx32s

import {Pagination} from 'react-infinite-pagination';
import 'react-infinite-pagination/lib/example.css';

const Datatable = () => {
  return <Pagination current={6} />;
};

Options

Name Type Description
pageInVisible Number The number of pages to display. Default: 10
current Number The current page selected. Default: 1
lastPage Number The total number of pages. If undefined the pagination will infinite
hideOnSinglePage Boolean Whether to hide pager on single page
wrapClassName String The class name of the container of the pagination. Default: infinite-pagination
itemClassName String The class name of the page item. Default: infinite-pagination-item
onChange Function(current: number) => void The callback executed when the page number is changed
renderPageItem Component<{current: number}> The component to render the page item
renderPrev Component<{current: number}> The component to render the previous button
renderNext Component<{current: number}> The component to render the next button

License

MIT