1.1.2 • Published 5 years ago

preact-paginate v1.1.2

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

preact-paginate

Installation

npm install preact-paginate -S

This is how it looks

Screenshot

Usage

Code Example:

import Pagination from "preact-paginate";

onChangePageClick(pageNo) {
  this.setState({ currentPageNo: pageNo });
  //Pass this pageNo to your API call along with the number of records you want to display on one page
  console.log(pageNo);
}

render(
  <div>
    <Pagination count={this.state.totalPages || 255} currentPageNo={this.state.currentPageNo || 1} onChangePageClick={this.onChangePageClick()} />
  </div>,
  document.body
);

Props

Properties used to customise the rendering:

NameTypeDescription
countNumber(required)Total Number of records to be displayed on list
currentPageNoNumber(required)Current Page Number
onChangePageClickFunction(required)Callback function to be called when user clicks next / previous button
1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago