1.0.1 • Published 6 years ago

material-ui-arrowy-pagination v1.0.1

Weekly downloads
22
License
-
Repository
github
Last release
6 years ago

material-ui-arrowy-pagination

An easy to use and customizable pagination component for Material-UI.

Demonstration

Notice


This component require material-ui version >= v1.0.0

FYI

material-ui@next

Quick Start


npm install material-ui-arrowy-pagination
import Pagination from 'material-ui-arrowy-pagination';

Usage


material-ui-pagination exposes one module called, Pagination, which accepts a few props:

OptionDescription
totalTotal number of pages
displayNumber of pages you want to show in the panel
currentCurrent page selected
onChangeHandles the change event of selected page: function(pageNumber: integer, previousPageNumber: integer) => void
styleStyles for root element
styleFirstPageButtonStyles for FirstPageButton. If not provided, a custom IconButton from Material UI will be rendered as default, otherwise <div> with styles will show up instead
stylePreviousPageButtonStyles for PreviousPageButton. If not provided, a custom IconButton from Material UI will be rendered as default, otherwise <div> with styles will show up instead
styleNextPageButtonStyles for NextPageButton. If not provided, a custom IconButton from Material UI will be rendered as default, otherwise <div> with styles will show up instead
styleLastPageButtonStyles for LastPageBottub. If not provided, a custom IconButton from Material UI will be rendered as default, otherwise <div> with styles will show up instead
styleButtonStyles for page number button. If not provided, a IconButton from Material UI will be rendered as default, otherwise <div> with styles will show up instead
stylePrimaryStyles for active page element. Requires the styleButton
showFirstPageButtoncontrol render FirstPageButton, default is false
showPreviousPageButtoncontrol render PreviousPageButton, default is false
showPageNumberButtoncontrol render showPageNumberButton, default is true
showNextPageButtoncontrol render NextPageButton, default is false
showLastPageButtoncontrol render LastPageButton, default is false

Run Local Demo


git clone https://github.com/shenxdtw/material-ui-arrowy-pagination
npm install
npm run dev-server
# visit http://localhost:7890/

Run Test


git clone https://github.com/shenxdtw/material-ui-arrowy-pagination
npm install
npm run test

Code Example


import Pagination from 'material-ui-arrowy-pagination';

<Pagination 
    total={10}
    current={1}
    display={5}
    onChange={(pageNumber, previousPageNumber) => {}}
    showFirstPageButton
    showPreviousPageButton
    showNextPageButton
    showLastPageButton
/>

Thanks


This project is modified with reference to material-ui-pagination.

Thanks to the author of material-ui-pagination.

License


MIT licensed.