New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

reaginate

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reaginate

A ReactJS component to render a pagination.

latest
Source
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

React Pager

A ReactJS component to render a pagination.

Installation

npm install reaginate --save

Screenshot

Image of reaginate component

Props

| Name | Type | Description | | --- | --- | --- | --- | | currentPage | Number | Required. The current page to display. | | totalPages | Number | Required. The total number of pages. | | onPageChange | Number | Required. A callback with the page number as an argument for when the page changes. | | onRefresh | Function | A function when the refresh button is clicked. If omitted, the button is not displayed. | | displayLabel | String | A label to display feedback for the user. i.e. Displaying 1 to 50 of 200 messages |

API

<Reaginate
    currentPage={ pager.currentPage }
    totalPages={ pager.totalPages }
    onPageChange={ this.onPageChange }
    onRefresh={ this.onRefresh }
    displayLabel={ `Displaying events 101 - 150 of 7765` }/>

Example usage

import React, {Component} from 'react';

import 'reaginate/src/reaginate.scss'
import Reaginate from 'reaginate';

class MessageInbox extends Component {

    constructor(props) {
        super(props);
        // Fetch data and then set state...
        this.state = {
            pager: {
                currentPage: 1,
                totalPages: 20
            }
        };
    }

    onPageChange(page) {
        const {totalPages} = this.state.pager;
        this.setState({
            pager: {
                currentPage: page,
                totalPages: totalPages
            }
        });
    }


    render() {
        const {pager} = this.state;
        return (
          <div>
              <Grid />
              <Reaginate
                  currentPage={ pager.currentPage }
                  totalPages={ pager.totalPages }
                  onPageChange={ this.onPageChange }
                  displayLabel={ `Displaying events 101 - 150 of 7765` }/>
          </div>
        );
    }
}

Keywords

pager

FAQs

Package last updated on 26 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts