Skip to content

<VueListPagination>

The default slot gives you full control over rendering pagination. You get all the computed state and helper functions needed to build a custom pagination layout from scratch.

vue
<template>
  <VueListPagination :page-links="5">
    <template #first></template>
    <template #prev></template>
    <template #page></template>
    <template #next></template>
    <template #last></template>
  </VueListPagination>
</template>

Heads up!

This component will only work when paginationMode prop is set to pagination on the root <VueList> component.

Props

NameDescription
pageLinksNumber
Defines how many pagination buttons should be visible at once. The current (active) page is centered when possible.

Slots

Following slots are available:

default

Use this to render the entire pagination manually. The default slot exposes a set of scoped variables that let you access and render the list state however you like.

vue
<template>
  <VueListPagination>
    <template #default="{...}">
      <!-- Render your pagination here -->
    </template>
  </VueListPagination>
</template>

Slot Props

NameDescription
pageNumber
The current active page number
perPageNumber
Items per page
countNumber
Total number of items returned by the API
pagesCountNumber
Total number of pages
pagesToDisplayArray
Array of visible page numbers (based on pageLinks prop)
halfWayNumber
Half of the pageLinks count (used for centering logic)
hasNextBoolean
Is there a next page?
hasPrevBoolean
Is there a previous page?
prevFunction
Go to previous page
nextFunction
Go to next page
firstFunction
Go to first page
lastFunction
Go to last page
setPageFunction
Navigate to specific page. Pass the page number as an argument

first

Button for navigating to the first page.

Exposes same slot props as default

prev

Button for navigating to the previous page.

Exposes same slot props as default

pages

Render visible page numbers.

Exposes same slot props as default

page

Button for each visible page number.

Exposes same slot props as default

Additionally, following helper slot props are available.:

Slot Props

NameDescription
pageNumber
The page number
isActiveBoolean
If the page is active

next

Button for navigating to the next page.

Exposes same slot props as default

last

Button for navigating to the last page.

Exposes same slot props as default

Version 2.1.1