@belong-ui/pagination

belong-ui: Pagination Component

Usage no npm install needed!

<script type="module">
  import belongUiPagination from 'https://cdn.skypack.dev/@belong-ui/pagination';
</script>

README

Pagination Usage:

const [PAGE_RANGE_DISPLAYED, PAGE_SIZE, totalResults] = [5, 15, 1000];

initialState = {
  activePage: 1,
};

<Pagination
  pageRangeDisplayed={PAGE_RANGE_DISPLAYED}
  activePage={state.activePage}
  itemsCountPerPage={PAGE_SIZE}
  totalItemsCount={totalResults}
  renderPrevPage={() => (<i className="fa fa-chevron-left"></i>)}
  renderNextPage={() => (<i className="fa fa-chevron-right"></i>)}
  onChange={(pageNumber) => {
    setState({ activePage: pageNumber });
  }}
/>