woocommerce/plugins/woocommerce-admin/client/components/pagination
Justin Shreve ba68ada59d Add Pagination Component (https://github.com/woocommerce/woocommerce-admin/pull/117)
* Add pagination component

* Refactor query string/route updating so it can be done using a nav-utils helper function

* Fix typo and adjust accessibility attributes for error handling and current page

* Update styles
2018-06-26 10:59:35 -04:00
..
README.md Add Pagination Component (https://github.com/woocommerce/woocommerce-admin/pull/117) 2018-06-26 10:59:35 -04:00
index.js Add Pagination Component (https://github.com/woocommerce/woocommerce-admin/pull/117) 2018-06-26 10:59:35 -04:00
style.scss Add Pagination Component (https://github.com/woocommerce/woocommerce-admin/pull/117) 2018-06-26 10:59:35 -04:00

README.md

Pagination

Use Pagination to allow navigation between pages that represent a collection of items. The component allows for selecting a new page and items per page options.

How to use:

import { Pagination } from 'components/pagination';

render: function() {
  return (
    <Pagination
		page={ this.state.page }
		perPage={ this.state.perPage }
		total={ 5000 }
		onPageChange={ this.onPageChange }
		onPerPageChange={ this.onPerPageChange }
	/>
  );
}

Props

  • page (required): The current page of the collection.
  • onPageChange: A function to execute when the page is changed.
  • perPage (required): The amount of results that are being displayed per page.
  • onPerPageChange: A function to execute when the per page option is changed.
  • total (required): The total number of results.
  • className: Additional classNames.