react-paginations [](https://travis-ci.org/trendmicro-frontend/react-paginations) [](https://coveralls.io/github/trendmicro-frontend/react-paginations?branch=master)

June 23, 2017 ยท View on GitHub

NPM

React Paginations

Demo: https://trendmicro-frontend.github.io/react-paginations

Installation

  1. Install the latest version of react and react-paginations:
npm install --save react @trendmicro/react-paginations
  1. At this point you can import @trendmicro/react-paginations and its styles in your application as follows:
import { TablePagination } from '@trendmicro/react-paginations';

// Be sure to include styles at some point, probably during your bootstraping
import '@trendmicro/react-paginations/dist/react-paginations.css';

Usage

TablePagination

<TablePagination
    type="full"
    page={this.state.page}
    pageLength={this.state.pageLength}
    totalRecords={this.state.totalRecords}
    onPageChange={({ page, pageLength }) => {
        this.setState({ page, pageLength })
    }}
    prevPageRenderer={() => <i className="fa fa-angle-left" />}
    nextPageRenderer={() => <i className="fa fa-angle-right" />}
/>

API

Properties

TablePagination

NameTypeDefaultDescription
typeString'full''full', 'reduced', or 'minor'
pageNumber1
pageLengthNumber10
pageLengthMenuArray[10, 25, 50, 100]
dropupBooleanfalseThe menu will open above the dropdown toggle, instead of below it.
totalRecordsNumber0
onPageChangeFunction
prevPageRendererFunction
nextPageRendererFunction
pageRecordsRendererFunction({ totalRecords, from, to })
pageLengthRendererFunction({ pageLength })

License

MIT