Skip to content

Pagination - AvPagination

✨ Introduction

The AvPagination is a pagination system compliant with good ergonomic and accessibility practices (ARIA). It allows easy navigation through multiple pages, with advanced features such as page display limitation and event management.

🏗️ Structure

This component displays links for the first, previous, middle, next and last pages, with adaptive controls according to pagination status.

🏷️ Props

NameTypeDefaultMandatoryDescription
compactbooleanfalseAllows compact display (Page x of y and navigation with only previous page and next page without text with just the icon).
pagesPage[]List of pages, where each page is an object containing information such as href and label.
truncLimitnumber2Maximum number of pages displayed.
currentPagenumber0Index of currently selected page (starts at 0).
firstPageLabelstringTooltip text for link to first page.
lastPageLabelstringTooltip text for link to last page.
nextPageLabelstringTooltip text for page link.
prevPageLabelstringTooltip text for previous page link.
compactCurrentPageLabelstringundefinedText for compact current page.

🔊 Events

NameData (payload)Description
'update:current-page'numberSent when user changes page.

🎨 Slots

None.

💡 Examples of use

vue
<template>
  <AvPagination
    id="top-pagination"
    :current-page="pageInfo.page"
    :pages="pages"
    aria-label="Top pagination"
    compact
    @update:current-page="onUpdateCurrentPage"
  />
</template>
vue
<template>
  <AvPagination
    id="bottom-pagination"
    :items="amss"
    :current-page="pageInfo.page"
    :pages="pages"
    aria-label="Bottom pagination"
    @update:current-page="onUpdateCurrentPage"
  />
</template>