Navigation
Pagination
The marker behind the current page is a single shared element that slides between positions, so changing page carries the eye to the new number instead of leaving it to hunt for where the highlight went. Long ranges elide, but only once eliding actually saves something - a seven-page list is never shortened, because hiding two of seven pages helps nobody. The gaps are characters, not buttons: there is nothing to click in the middle of a jump.
npx shadcn@latest add @minflow/paginationWhere to use it
- Result sets where the page number itself is meaningful and people jump around - search results, archives, logs.
- Anywhere a URL should be shareable and reproducible, which infinite scroll cannot promise.
- Not for feeds that are browsed continuously - there, loading more is the interaction, not choosing a page.
Variations
Short range
Up to about seven pages, where every page can be shown and eliding would only add ambiguity.
Long range
Large sets. The first and last pages stay pinned so the size of the set is always visible, and the neighbours of the current page stay reachable.