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.
- Host: GitHub
- URL: https://github.com/dbtek/mui-pagination
- Owner: dbtek
- Created: 2019-02-07T09:40:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-18T09:04:08.000Z (about 7 years ago)
- Last Synced: 2025-10-06T21:31:28.023Z (8 months ago)
- Topics: material-ui, pagination, react
- Language: JavaScript
- Size: 41 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)