2.1.4 • Published 5 years ago

@eluck/material-ui-flat-pagination-2.1.4 v2.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

material-ui-flat-pagination

Build Status Coverage Status npm version

A pagination component for Material-UI using Flat Button.

Installation

npm install material-ui-flat-pagination

Demo

Demo

Demo

Example

import React from 'react';
import ReactDOM from 'react-dom';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import FlatPagination from 'material-ui-flat-pagination';

class Example extends React.Component {
  constructor() {
    super();
    this.state = {offset: 0};
  }

  handleClick(offset) {
    this.setState({offset});
  }

  render() {
    return (
      <MuiThemeProvider>
        <FlatPagination
          offset={this.state.offset}
          limit={10}
          total={100}
          onClick={(e, offset) => this.handleClick(offset)}
        />
      </MuiThemeProvider>
    );
  }
}

ReactDOM.render(
  <Example/>,
  document.getElementById('app')
);

Props

NameTypeDefaultDescription
limit (required)validateNumberThe number of rows per page. Allow a number greater than or equal to 1.
offset (required)validateNumberThe number of rows to skip. Allow a number greater than or equal to 0.
total (required)validateNumberThe total number of rows. Allow a number greater than or equal to 0.
classNamestringThe CSS class name of the root element.
currentPageHoverColorstringColor of the current page button when mouse hovers over.
currentPageLabelStyleobjectOverride the inline-styles of the button's label element of current page.
currentPageStyleobjectOverride the inline-styles of the button element of current page.
disabledboolfalseIf true, the button will be disabled.
disableTouchRippleboolfalseIf true, the button's ripple effect will be disabled.
hoverColorstringColor of button when mouse hovers over.
nextPageLabelnode'>'Label for the next page button.
onClickfuncCallback function fired when the button is clicked.Signature:function(event: object, offset: number) => voidevent: Click event targeting the button.offset: The number of new offset.
otherPageLabelStyleobjectOverride the inline-styles of the button's label element of other pages except the current page.
otherPageStyleobjectOverride the inline-styles of the button element of other pages except the current page.
previousPageLabelnode'<'Label for the previous page button.
rippleColorstringColor for the ripple after button is clicked.
reducedboolfalseReduce the number of displayed buttons if set to true.
styleobjectOverride the inline-styles of the root element.

License

MIT, see LICENSE for details.

2.1.4

5 years ago