Pagination reference for Loomi for Shopify

Experience customization lets you personalize the pagination component in your storefront. The pagination component renders page navigation controls below the product grid, including previous and next buttons, numbered page links, and ellipsis gaps. Use the data attributes and EJS variables on this page to customize the markup and disabled states. For page layout requirements, see the Loomi for Shopify HTML and EJS reference.

Pagination component showing page number buttons, previous and next controls, and ellipsis gaps.

Data attributes

AttributeElementValueBehavior
data-br-actionPrevious buttonpagination-prevClick goes to the previous page when not on page 1. Fires br-page-change. The parent loads the prior result set, updates the active page styling, and refreshes the product grid.
data-br-actionNext buttonpagination-nextClick goes to the next page when not on the last page. Same refresh as prev.
data-br-actionPage number buttonpagination-pageClick jumps to that page number. Fires br-page-change and reloads results for the page.
data-br-pagePage number buttonPage number (for example, 1)Supplies the target page index for pagination-page clicks. Wrong values navigate to the wrong page or no-op.

EJS variables

The pagination object exposes these fields:

FieldDescriptionData type
currentPageActive page.number
totalPagesTotal page count.number
pageNumbersSequence to render. Uses "ellipsis" for gaps.(number | "ellipsis")[]
isPrevDisabledtrue on the first page.boolean
isNextDisabledtrue on the last page.boolean
actionsData attribute constants for event delegation: { prev: “pagination-prev”, next: “pagination-next”, page: “pagination-page” }object

Example

<button data-br-action="<%= pagination.actions.prev %>" <%= pagination.isPrevDisabled ? 'disabled' : '' %>>Prev</button>
<% pagination.pageNumbers.forEach(function(page) { %>
  <% if (page === 'ellipsis') { %>
    <span>…</span>
  <% } else { %>
    <button
      data-br-action="<%= pagination.actions.page %>"
      data-br-page="<%= page %>"
    ><%= page %></button>
  <% } %>
<% }); %>
<button data-br-action="<%= pagination.actions.next %>" <%= pagination.isNextDisabled ? 'disabled' : '' %>>Next</button>

Did this page help you?

© Bloomreach, Inc. All rights reserved.