rc-pagination, react-js-pagination, and react-paginate are libraries used to add pagination controls to React applications. They help developers split large datasets into manageable pages, providing navigation UI like next/prev buttons and page numbers. While they share the same goal, they differ significantly in API design, customization options, and long-term maintenance status.
Adding pagination to a React app seems simple until you need to handle edge cases, custom styling, or specific state management. rc-pagination, react-js-pagination, and react-paginate all solve this problem, but they take different approaches to API design and extensibility. Let's look at how they handle real-world engineering challenges.
rc-pagination uses a controlled component pattern similar to Ant Design.
current and total explicitly.onChange when the page changes.// rc-pagination: Controlled API
<Pagination
current={currentPage}
total={totalItems}
onChange={(page, pageSize) => handlePageChange(page)}
/>
react-js-pagination also uses a controlled pattern but with different prop names.
activePage instead of current.itemsCountPerPage to calculate pages internally.// react-js-pagination: Controlled API
<Pagination
activePage={currentPage}
itemsCountPerPage={10}
totalItemsCount={totalItems}
onChange={(page) => handlePageChange(page)}
/>
react-paginate shifts the calculation burden to the developer.
pageCount (total pages) instead of total items.onPageChange with an event object containing selected.// react-paginate: Page Count API
<ReactPaginate
pageCount={Math.ceil(totalItems / itemsPerPage)}
onPageChange={(event) => handlePageChange(event.selected + 1)}
/>
rc-pagination allows you to override every single node.
itemRender prop lets you define custom HTML for prev, next, and page links.// rc-pagination: Custom Item Rendering
<Pagination
itemRender={(page, type, originalElement) => {
if (type === 'prev') return <button>Back</button>;
if (type === 'next') return <button>Next</button>;
return <a>{page}</a>;
}}
/>
react-js-pagination relies on CSS classes for styling.
innerClass, itemClass, and activeClass to hook into CSS.// react-js-pagination: Class-based Styling
<Pagination
innerClass="pagination"
activeClass="active"
itemClass="page-item"
/>
react-paginate uses a break view and margin pages configuration.
marginPagesDisplayed.breakLabel to handle ellipsis customization.// react-paginate: Break and Margin Config
<ReactPaginate
marginPagesDisplayed={2}
pageRangeDisplayed={5}
breakLabel="..."
activeClassName="selected"
/>
rc-pagination is part of the react-component organization.
// rc-pagination: Ecosystem
// Often used alongside other rc-* components
import Pagination from 'rc-pagination';
react-js-pagination has seen infrequent updates recently.
// react-js-pagination: Legacy Warning
// Check npm last publish date before installing
import Pagination from 'react-js-pagination';
react-paginate is a community favorite for standalone needs.
// react-paginate: Standalone
// No heavy dependencies
import ReactPaginate from 'react-paginate';
| Feature | rc-pagination | react-js-pagination | react-paginate |
|---|---|---|---|
| Page Input | total items | totalItemsCount | pageCount |
| Current Page | current | activePage | forcePage (optional) |
| Callback | onChange | onChange | onPageChange |
| Custom Render | itemRender (function) | CSS Classes only | breakLabel / Config |
| Maintenance | π’ High (Ant Design) | π‘ Low (Legacy) | π’ High (Community) |
rc-pagination is the power user's choice π§. It gives you the most control over rendering and state, making it perfect for design systems or complex apps where pagination needs to look unique.
react-js-pagination is the legacy option π°οΈ. It works, but the lack of recent activity makes it a risky choice for new greenfield projects. Stick to it only if you are maintaining an older app.
react-paginate is the balanced standard βοΈ. It abstracts the math just enough to be useful without locking you into a specific UI kit. It is the safest bet for most standard React applications.
Final Thought: All three libraries handle the core task of splitting data into pages. However, your choice should depend on how much control you need over the HTML structure and how much you value long-term library maintenance.
Choose rc-pagination if you need deep customization of the pagination structure or are already using Ant Design. It offers low-level control over every rendered element via the itemRender prop and is actively maintained by the React Component ecosystem.
Avoid react-js-pagination for new projects as it shows signs of low maintenance activity compared to alternatives. Only consider it if you are maintaining a legacy codebase that already depends on it and migration costs are too high.
Choose react-paginate for a reliable, standalone solution that balances ease of use with flexibility. It is widely adopted, actively maintained, and provides a clear API for handling page changes without tying you to a specific UI framework.
React Pagination Component.
npm install
npm start
Online example: https://pagination-react-component.vercel.app
Local example: npm run start then http://localhost:9001
import Pagination from 'rc-pagination';
ReactDOM.render(<Pagination />, container);
// 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 | ['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 |
rc-pagination is released under the MIT license.