Pagination Helpers
Various helpers related to pagination specific functionality.
yarn add @corets/pagination-helpersnpm install --save @corets/pagination-helperscreatePagination()
< << ... 6 7 8 [9] 10 11 12 ... >> >
< << 7 8 [9] 10 11 >> >
< ... 7 8 [9] 10 11 ... >
< [9] >
[ v Select page ]import { createPagination } from "@corets/pagination-helpers"
// active page
const currentPage = 7
// total number of items for pagination
const totalItems = 1337
// how many items are visible on a single page
const pageSize = 20
// how many pages you want to display to the left and right of the current page
const surroundBy = 2
const pagination = createPagination({ currentPage, totalItems, pageSize, surroundBy })Last updated
Was this helpful?