Skip to content

Pagination

Page-number navigation (nav aria-label="Pagination") with previous/next controls. Renders one button per page — for very large totalPages, consider paging through results some other way, since this doesn’t truncate with an ellipsis.

<and-pagination id="pager" current-page="2" total-pages="5"></and-pagination>
<script>
pager.addEventListener('andPageChange', e => (pager.currentPage = e.detail));
</script>
PropertyAttributeDescriptionTypeDefault
currentPagecurrent-pageCurrent active page (1-based).number1
totalPagestotal-pagesTotal number of pages.number1
EventDescriptionType
andPageChangeEmitted when the page changes.CustomEvent<number>