d36511479e
* 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 |
||
---|---|---|
.. | ||
README.md | ||
index.js | ||
style.scss |
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.