An open API service indexing awesome lists of open source software.

https://github.com/dbtek/mui-pagination

A pagination component for React built with Material-UI.
https://github.com/dbtek/mui-pagination

material-ui pagination react

Last synced: about 1 month ago
JSON representation

A pagination component for React built with Material-UI.

Awesome Lists containing this project

README

          


mui-pagination


:one::two::three:



A pagination component for React built with material-ui. Makes use of ToggleButton with pagination-generator-js by Zarko Selak.


### Install
```bash
$ npm i -S mui-pagination
# or with yarn
$ yarn add mui-pagination
```

### Usage
```js
import React, { Component } from 'react'
import Pagination from 'mui-pagination'

class PaginatedList extends Component {
state = {
page: 1,
totalItems: 100,
itemsPerPage: 10
}

handlePageChange (page) {
this.setState({ page })
}

render () {
const { page, totalItems, itemsPerPage } = this.state
return (


{/* items */}
this.handlePageChange(val)}
/>

)
}
}
```

### API

**Props***
`totalItems` `{Number} *`
Total number of items.

`itemsPerPage` `{Number} *`
Items to show on each page.

`page` `{Number} *`
Current page number.

### Author
Ismail Demirbilek - [@dbtek](https://twitter.com/dbtek)