0.2.5 • Published 5 years ago

@oryono/react-paginator v0.2.5

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

react-paginator npm version

The way you use it is similar to Laravel's paginator.

Installation

Through npm

npm install @oryono/react-paginator --save

Usage

import Paginator from '@oryono/react-paginator'
import React, { Component } from 'react'
import getUsers from './actions'

class ComponentName extends Component {
    // Your page handler could be something like this
    handlePageChange = page => {
        getUsers(page);
    };
    render () {
        return (
            <React.Fragment>
                  <Users />
                  <Paginator
                      totalCount={50}  /*This is the total number of items */
                      currentPage={1} /* Current page as from the api */
                      pageSize={10} /* Page size */
                      onPageChange={ this.handlePageChange } /* This is what happens when a page is clicked */
                  />
            </React.Fragment>

        )
                
    }
                
}

That's it.

You should consider contributing to this noble cause 😜

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago