woocommerce/plugins/woocommerce-admin/client/components/pagination
Kelly Dwan d36511479e Docs Project: Add documentation parser + inline documentation (https://github.com/woocommerce/woocommerce-admin/pull/336)
* Switch all components to default exports

This ensures we can read all components for documentation generation (plus, standardizing is good)

* Add documentation to component file

* Fix table exports

* Move readme docs into inline docs

Includes updating new props, adding prop shapes

* Add doc-generation scripts to pull exported component docs into folder

* Remove key propType, causing react special-keys warning

* Fix proptype

* Update incorrect comment

* Remove template import, we can just use string concat

* Fix typo, update docs
2018-08-31 13:27:21 -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 Docs Project: Add documentation parser + inline documentation (https://github.com/woocommerce/woocommerce-admin/pull/336) 2018-08-31 13:27:21 -04:00
style.scss Activity Panel: Unread bubble, animations, cleaned up styles/mobile handling (https://github.com/woocommerce/woocommerce-admin/pull/154) 2018-07-06 08:40:05 -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.