feat(pagination): add support for non-numbered pagination
- Related issue: #208 (closed)
This MR adds a compact mode to the pagination. This mode can be used to display pagination where only the previous and next buttons are visible, which is useful for paginating content where we can't retrieve the total items count, like for GitLab's pipelines listing: https://gitlab.com/gitlab-org/gitlab/pipelines
To summarize the changes:
- The
totalItems
prop isn't required anymore. - We now have two new props:
prevPage
andnextPage
. - When
totalItems
isn't provided and at least one of the two new props is specified, compact mode is enabled. - An example and a story have been added to demonstrate the compact mode, they both showcase a compact pagination with 3 pages total, with the initial page set to
#3
.
w/o prev page, w/ next page | w/ prev & next page | w/ prev page, w/o next page |
---|---|---|
![]() |
![]() |
![]() |
Close #208 (closed)
Edited by Paul Gascou-Vaillancourt