AddThisFeature

Pagination

Split long lists into numbered pages without losing filters or the user's place.

moderate Navigation

What it adds

Discrete paged lists with an explicit page control, where page number, page size, filters, and sort all live in the URL.

What your agent is told to do

7
  1. 1

    Build a real page control: previous, next, and a way to jump to a specific page or the last page. This feature is for lists people navigate deliberately. If the list is a feed people graze, choose progressive appending instead.

  2. 2

    Put page, page size, filters, and sort in the URL so every page is linkable, bookmarkable, and survives a refresh.

  3. 3

    Show enough context to orient: current page, total pages or a clear next-page affordance, and the range of items shown out of the total.

  4. 4

    Offer a page-size choice where rows vary in density, and persist the user's preference.

  5. 5

    Keep filters and sort applied when the page changes, and reset to page one whenever a filter or sort changes.

  6. 6

    Use cursor-based pagination for large or fast-moving datasets. Deep offsets get slow and skip records as rows shift underneath.

  7. 7

    Do NOT compute an exact total count on every request for large tables. Either cache it, estimate it, or drop it in favour of a next-page indicator.

Edge cases it handles

7
  • Deleting the last item on the last page must land the user on a valid page, not an empty one with no way back.
  • A page number beyond the end of the results should clamp to the last page rather than render a blank screen.
  • Records inserted or removed between requests can duplicate or skip items under offset pagination. Sort on a stable tiebreaker such as the primary key.
  • Filtered results of zero must show the empty state with a way to clear filters, not page one of nothing.
  • Pagination controls need real labels for screen readers and must be reachable and operable by keyboard.
  • Returning from a detail view should come back to the page the user left, not page one.
  • Page size changes must recompute the current page so the user stays roughly where they were.

Definition of done

9
  • Page, page size, filters, and sort are all reflected in the URL, and any page is directly linkable.
  • An explicit page control offers previous, next, and a jump to a chosen page.
  • Changing a filter resets to the first page and keeps the filter applied.
  • Deleting the last item on the last page redirects to a valid page.
  • Sorting includes a stable tiebreaker so records are neither skipped nor duplicated.
  • Controls are keyboard operable and labelled for assistive technology.
  • Returning from a detail view restores the previous page.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.