Ability to disable `Pager` on `Pagination`
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
What problem does this feature solve?
The pagination component is heavily oriented towards “Offset-style Pagination” (see https://dev-blog.apollodata.com/understanding-pagination-rest-graphql-and-relay-b10f835549e7 for an overview of different types of pagination). There is nothing wrong with that. However, there are cases where the end-user experience necessitates a “Cursor-style Pagination”, i.e. infinite loading of a stream of real-time data, and in such a case, page numbering (or the Pager
) does not really work because we do not know the “cursor” for every page.
What does the proposed API look like?
I believe this requires a change on https://github.com/react-component/pagination as well. I propose a new prop like showPager
(taking inspiration from how the other props are named). To preserve compatibility with existing uses of Pagination
, I also propose the default value be set to true
. I understand that it is not too difficult to mimic a simple next / previous pagination via buttons, but having this option is more convenient for end-users (i.e. the developers).
Having a closer look at the API, I believe disabling the Pager
alone might not be sufficient to achieve cursor-style pagination as it still has some knowledge of a “page number” in other parts.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:16
- Comments:17 (6 by maintainers)
Top GitHub Comments
+1 for this @MrSaints i need it too. When You have small table with like 1-4 pages i really don’t need pagers and don’t want it at all.
PS. Moreover i need option for count ‘results’ not pages like from “page 1/3” => “posts 1-10/27” so i will ask for it too but better will be just to add item renderer as it is done for ‘next/page/prev’ items in pagination API.
The quick and dirty solution is to simply hide the stuff between the
<
and>
arrows