rc-pagination@1.20.5

pagination ui component for react

import 'rc-pagination/assets/index.css';
import Pagination from 'rc-pagination';
import React from 'react';
import ReactDOM from 'react-dom';

const itemRender = (current, type, element) => {
  if (type === 'page') {
    return <a href={`#${current}`}>{current}</a>;
  }
  return element;
};

const textItemRender = (current, type, element) => {
  if (type === 'prev') {
    return 'Prev';
  }
  if (type === 'next') {
    return 'Next';
  }
  return element;
};

ReactDOM.render(
  <div>
    <Pagination total={100} itemRender={itemRender} />
    <Pagination total={100} itemRender={textItemRender} />
  </div>
, document.getElementById('__react-content'));
Fork me on GitHub