woocommerce/plugins/woocommerce-admin/packages/components/src/pagination
Hsing-yu Flowers 3d0e00ed0b Make pagination buttons height and width consistent (https://github.com/woocommerce/woocommerce-admin/pull/6725)
* Make pagination buttons height and width consistent

* Add changelog
2021-04-13 10:30:56 -04:00
..
stories Add @woocommerce/eslint-plugin (https://github.com/woocommerce/woocommerce-admin/pull/4714) 2020-07-28 14:32:58 +12:00
README.md Add showPagePicker, showPerPagePicker props to Pagination component (https://github.com/woocommerce/woocommerce-admin/pull/3980) 2020-03-27 11:24:51 +10:30
index.js IconButton: Replace with Button (https://github.com/woocommerce/woocommerce-admin/pull/4415) 2020-05-29 14:32:37 +12:00
style.scss Make pagination buttons height and width consistent (https://github.com/woocommerce/woocommerce-admin/pull/6725) 2021-04-13 10:30:56 -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.

Usage

<Pagination
	page={ 1 }
	perPage={ 10 }
	total={ 500 }
	onPageChange={ ( newPage ) => setState( { page: newPage } ) }
	onPerPageChange={ ( newPerPage ) => setState( { perPage: newPerPage } ) }
/>

Props

Name Type Default Description
page Number null (required) The current page of the collection
onPageChange Function noop A function to execute when the page is changed
perPage Number null (required) The amount of results that are being displayed per page
onPerPageChange Function noop A function to execute when the per page option is changed
total Number null (required) The total number of results
className String null Additional classNames
showPagePicker Boolean true Whether the page picker should be shown.
showPerPagePicker Boolean true Whether the per page picker should shown.
showPageArrowsLabel Boolean true Whether the page arrows label should be shown.