Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

rc-pagination

react-component7.4mMIT5.1.0TypeScript support: included

pagination ui component for react

react, react-component, react-pagination, pagination, antd, pager

readme

rc-pagination

React Pagination Component.

NPM version npm download build status Codecov bundle size dumi

Development

npm install
npm start

Examples

Online example: https://pagination-react-component.vercel.app Local example: npm run start then http://localhost:9001

Install

rc-pagination

Usage

import Pagination from 'rc-pagination';

ReactDOM.render(<Pagination />, container);

API

// prettier-ignore | Parameter | Description | Type | Default | | --- | --- | --- | --- | | disabled | disable pagination | Bool | - | | align | align of pagination | start | center | end | undefined | | defaultCurrent | uncontrolled current page | Number | 1 | | current | current page | Number | undefined | | total | items total count | Number | 0 | | defaultPageSize | default items per page | Number | 10 | | pageSize | items per page | Number | 10 | | onChange | page change callback | Function(current, pageSize) | - | | showSizeChanger | show pageSize changer | boolean | SelectProps | false when total less than totalBoundaryShowSizeChanger, true when otherwise | | totalBoundaryShowSizeChanger | when total larger than it, showSizeChanger will be true | number | 50 | | pageSizeOptions | specify the sizeChanger selections | Array<String> | ['10', '20', '50', '100'] | | onShowSizeChange | pageSize change callback | Function(current, size) | - | | hideOnSinglePage | hide on single page | Bool | false | | showPrevNextJumpers | show jump-prev, jump-next | Bool | true | | showQuickJumper | show quick goto jumper | Bool / Object | false / {goButton: true} | | showTotal | show total records and range | Function(total, [from, to]) | - | | className | className of pagination | String | - | | simple | when set, show simple pager | Bool / { readOnly?: boolean; } | - | | locale | to set l10n config | Object | zh_CN | | style | the style of pagination | Object | {} | | showLessItems | show less page items | Bool | false | | showTitle | show page items title | Bool | true | | itemRender | custom page item renderer | Function(current, type: 'page' | 'prev' | 'next' | 'jump-prev' | 'jump-next', element): React.ReactNode | (current, type, element) => element | | | prevIcon | specify the default previous icon | ReactNode | (props: PaginationProps) => ReactNode | | | nextIcon | specify the default next icon | ReactNode | (props: PaginationProps) => ReactNode | | | jumpPrevIcon | specify the default previous icon | ReactNode | (props: PaginationProps) => ReactNode | | | jumpNextIcon | specify the default next icon | ReactNode | (props: PaginationProps) => ReactNode | |

License

rc-pagination is released under the MIT license.

changelog

2.2.0

  • Add prop totalBoundaryShowSizeChanger.
  • Fix items count not being consistent. #18201
  • Update default page size options from 10,25,50,100 to 10,20,50,100.

2.1.0

  • When total is greater then 100, will show size changer defaultly.
  • Update default page size options from 10,20,30,40 to 10,25,50,100.

2.0.0

  • Remove prop-types and react-lifecycles-compat

    1.20.0

  • Add locale ms_MY

    1.19.0

  • Support Latvian localization

    1.18.0

  • Support disabled

    1.17.0

  • Add prevIcon, nextIcon, jumpPrevIcon, jumpNextIcon.

    1.16.1

  • Add locale sl_SI. #130

    1.16.0

  • Add locale id_ID

  • Add prop showPrevNextJumpers

    1.15.2

  • Add locale tr_TR.

    1.12.0

  • itemRender(current, type) => itemRender(current, type, element): element.

    1.11.0

  • Add goButton.

    1.10.0

  • Add itemRender.

    1.9.0

  • Add keyboard support

  • Add es folder.

    1.8.0

  • Add locale zh_TW.

  • Add showTitle.

    1.7.5

  • Add locale sk_SK(Slovak).

    1.7.4

  • Add locale et_EE(Estonian).

    1.7.3

  • Add locale Czech.

    1.7.2

  • Add locale ko_KR(Korean).

    1.7.1

  • Add locale ca_ES (Catalan).

    1.7.0

  • support showLessItems. #55

  • Add pageSize as onChange's second argument.

    1.6.0

  • Add range as showTotal's second argument.

    1.5.5 / 2016-09-01

  • Fix #34

    1.5.4 / 2016-07-31

  • Add space before per page #33

    1.5.0 / 2016-03-02

  • Add defaultPageSize and fix pageSize to a controlled prop

    1.3.0 / 2015-11-25

  • Add defaultCurrent prop

    1.2.0

  • Allow specifying the page size for sizeChanger