All Projects → franciskim722 → materialui-pagination

franciskim722 / materialui-pagination

Licence: MIT license
A simple pagination component for Material UI.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to materialui-pagination

Infinitescrolling
Add infinite scrolling to collection view.
Stars: ✭ 156 (+403.23%)
Mutual labels:  pagination
Jquerydatatablesserverside
Asp.Net Core Server Side for Jquery DataTables Multiple Column Filtering and Sorting with Pagination and Excel Export
Stars: ✭ 191 (+516.13%)
Mutual labels:  pagination
Tablefilter
A Javascript library making HTML tables filterable and a bit more :)
Stars: ✭ 248 (+700%)
Mutual labels:  pagination
React Paginate
A ReactJS component that creates a pagination
Stars: ✭ 2,169 (+6896.77%)
Mutual labels:  pagination
Vue Bootstrap4 Table
Advanced table based on Vue 2 and Bootstrap 4 ⚡️
Stars: ✭ 187 (+503.23%)
Mutual labels:  pagination
V Selectpage
SelectPage for Vue2, list or table view of pagination, use tags for multiple selection, i18n and server side resources supports
Stars: ✭ 211 (+580.65%)
Mutual labels:  pagination
Vue Pagination 2
Vue.js 2 pagination component
Stars: ✭ 144 (+364.52%)
Mutual labels:  pagination
Ajaxinate
🎡 Ajax pagination plugin for Shopify themes
Stars: ✭ 107 (+245.16%)
Mutual labels:  pagination
Rummage ecto
Search, Sort and Pagination for ecto queries
Stars: ✭ 190 (+512.9%)
Mutual labels:  pagination
Instagram Proxy Api
CORS compliant API to access Instagram's public data
Stars: ✭ 245 (+690.32%)
Mutual labels:  pagination
Advancedlist
Advanced List View for SwiftUI with pagination & different states
Stars: ✭ 165 (+432.26%)
Mutual labels:  pagination
Nopaginate
Android pagination library (updated 01.05.2018)
Stars: ✭ 180 (+480.65%)
Mutual labels:  pagination
Sqlhelper
SQL Tools ( Dialect, Pagination, DDL dump, UrlParser, SqlStatementParser, WallFilter, BatchExecutor for Test) based Java. it is easy to integration into any ORM frameworks
Stars: ✭ 242 (+680.65%)
Mutual labels:  pagination
Combine Pagination
A JavaScript library for paginating data from multiple sources 🦑
Stars: ✭ 157 (+406.45%)
Mutual labels:  pagination
flask-rest-paginate
Pagination Extension for flask-restful
Stars: ✭ 18 (-41.94%)
Mutual labels:  pagination
Vuejs Datatable
A Vue.js component for filterable and paginated tables.
Stars: ✭ 148 (+377.42%)
Mutual labels:  pagination
React Table
⚛️ Hooks for building fast and extendable tables and datagrids for React
Stars: ✭ 15,739 (+50670.97%)
Mutual labels:  pagination
blogging-app-with-Angular-CloudFirestore
A blogging application created with the help of Angular on front-end and Google Cloud Firestore on backend.
Stars: ✭ 45 (+45.16%)
Mutual labels:  pagination
vue-laypage
📃 A simple pagination component for Vue.js 2.x
Stars: ✭ 25 (-19.35%)
Mutual labels:  pagination
Gatsby Starter Business
Gatsby Business Website Starter
Stars: ✭ 243 (+683.87%)
Mutual labels:  pagination

materialui-pagination

A simple pagination component for Material UI.

Based on Material Design Data Table Guidelines.

Demo

Installation

$ npm install materialui-pagination

Example

  //React
  import React  from 'react';
  import PropTypes from 'prop-types';
  import {render} from 'react-dom';

  //Material UI Dependency for touch / tap / click events
  import injectTapEventPlugin from 'react-tap-event-plugin';
  injectTapEventPlugin();

  //Material UI Components
  import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
  import {Card} from 'material-ui/Card';
  import Divider from 'material-ui/Divider';
  import {Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn} from 'material-ui/Table';

  //Import the pagination component
  import Pagination from 'materialui-pagination';

  //Demo API to simulate async actions
  import RowApi from './api/rows';

  class ExampleTable extends React.Component {

      constructor(props, context) {
          super(props, context);
    
          this.state = {
            rowsPerPage: [5,10,15],
            rows: [],
            numberOfRows: 5,
            page: 1,
            total: undefined
          };

            this.updateRows = this.updateRows.bind(this);
      }


      componentWillMount() {
        RowApi.getRows(this.state)
        .then((updatedState) => {
          this.setState(updatedState);
        });
      }

      updateRows(state){
        RowApi.getRows(state)
        .then((updatedState) => {
          this.setState(updatedState);
        });
      }

      render(){
          return (
            <MuiThemeProvider>
              <Card>
                <Table>
                  <TableHeader>
                    <TableRow>
                      <TableHeaderColumn>Row Number</TableHeaderColumn>
                    </TableRow>
                  </TableHeader>
                  <TableBody>
                  {this.state.rows.map((row, index) => {
                      return (
                        <TableRow key={index}>
                          <TableRowColumn>{row}</TableRowColumn>
                        </TableRow>
                      );
                    })}
                  </TableBody>
                </Table>
                <Divider />
                <Pagination
                  total={this.state.total}
                  rowsPerPage={this.state.rowsPerPage}
                  page={this.state.page}
                  numberOfRows={this.state.numberOfRows}
                  updateRows={this.updateRows}
                />
              </Card>
            </MuiThemeProvider>
          );
      }
  }

  render(<ExampleTable />, document.querySelector('#app'))

Pagination Properties

Name Type Default Description
rowsPerPage array [10, 20, 30] The number of rows to display per page.
numberOfRows number 10 The selected number of rows to display.
page number 1 The selected page number.
total number 0 The total number of results in the dataset.
updateRows function Callback function fired when the rows array is updated.
pageTitle string 'Page:' The title for the selected page number.
rowsPerPageTitle string 'Rows Per Page:' Title for the number of rows to display per page.
prepositionForRowRange string 'of' Preposition for the current range of numbers of displayed rows.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].