react-infinite-pagination
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

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

Usage(Hooks only)

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

Package Sidebar

Install

npm i react-infinite-pagination

Weekly Downloads

26

Version

1.1.1

License

MIT

Unpacked Size

13.7 kB

Total Files

14

Last publish

Collaborators

  • nghiepit