UNPKG

@swrve/core

Version:

Core set of Swrve UI Components

25 lines (14 loc) 660 B
# Proposal for Pagination ## Home `@swrve/core` ## Import `import { Pagination } from '@swrve/core'` ## Implementation Will try keep this is as simple as possible for now just creating basic as possible pagination component. ### Props `activePage` Currently active page `numberOfPages` Total number of pages `maxButtons` Max Number of buttons to show with page numbers `onSelect` callback to be fired when clicking on pagination button will return `page number` ### Prev / Next Prev / Next buttons to be displayed if it makes sense. I.e. if on page 0 then `Prev` is hidden / disabled, or if `activePage` equals `numberOfPages` then next is disabled.