Skip to main content

Pagination

The Storefront API uses cursors to paginate through lists of data and the <Pagination /> component makes it easy to paginate data from the Storefront API. It is important for pagination state to be maintained in the URL, so that the user can navigate to a product and return back to the same scrolled position in a list. It is also important that the list state is shareable via URL. The <Pagination> component provides a render prop with properties to load more elements into your list.

Anchor to children
children
<NodesType>
required

A render prop that includes pagination data and helpers.

Anchor to connection
connection
<NodesType>
required

The response from storefront.query for a paginated request. Make sure the query is passed pagination variables and that the query has pageInfo with hasPreviousPage, hasNextpage, startCursor, and endCursor defined.

Anchor to namespace
namespace
string

A namespace for the pagination component to avoid URL param conflicts when using multiple Pagination components on a single page.



Was this page helpful?