Skip to content

feat(pagination): add support for non-numbered pagination

Paul Gascou-Vaillancourt requested to merge pagination-support-non-numbered into master

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:

  1. The totalItems prop isn't required anymore.
  2. We now have two new props: prevPage and nextPage.
  3. When totalItems isn't provided and at least one of the two new props is specified, compact mode is enabled.
  4. 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
image image image

Close #208 (closed)

Edited by Paul Gascou-Vaillancourt

Merge request reports