Pagination     

The Quasar Pagination component is available for whenever a pagination system is required. It offers the user a simple UI to help you in moving between pages/items.

There are two modes in which QPagination operates: with buttons only or with an inputbox. The latter mode allows the user to go to a specific page by clicking/tapping on the inputbox, typing the page number then hitting Enter key and if the new page number is within valid limits, the model will be changed accordingly.

Installation

Edit /quasar.conf.js:

framework: {
components: ['QPagination']
}

Basic Usage

<q-pagination v-model="page" :max="17" />

Vue Properties

Supports v-model.

Vue PropertyTypeDescription
minNumberNumber of the first page; Default: 1
maxNumber(Required) Number of last page
colorStringOne from Quasar Color Palette
text-colorStringText color of current selection button, one from Quasar Color Palette
sizeStringButton size (check “size” prop from Buttons)
inputBooleanUse inputbox mode instead of buttons
boundary-linksBooleanShow boundary button links
boundary-numbersBooleanShow boundary number buttons
direction-linksBooleanShow direction buttons
ellipsesBooleanShow ellipses when pages available > “max-pages” prop.
max-pagesNumberMaximum number of page links to display at a time.
disableBooleanIf no value is provided (empty attribute), then it’s considered as set to true.

If you’d like to set the minimum starting page or the max number of pages, you can do so, as in the example below.

<template>
<q-pagination v-model="page" :min="minPages" :max="maxPages" />
</template>

<script>
export default {
data () {
return {
page: 4,
minPages: 4,
maxPages: 27
}
}
}
</script>

This will cause the pagination to initially render to page 4 and not allow the user to go below page 4.

Vue Events

Vue EventDescription
@input(newVal)Triggered immediately on model value change.
@change(newVal)Triggered on lazy model value change.

Examples

With buttons

<q-pagination
v-model="page"
:min="1"
:max="6"
/>

With inputbox

<q-pagination
input
v-model="page"
:min="1"
:max="6"
/>
<q-pagination
v-model="page2"
color="secondary"
:min="1"
:max="15"
:max-pages="6"
/>

With no ellipses

<q-pagination
v-model="page2"
color="amber"
text-color="black"
:min="1"
:max="15"
:max-pages="6"
:ellipses="false"
/>
<q-pagination
v-model="page2"
color="purple"
:min="1"
:max="15"
:max-pages="6"
boundary-links
/>
<q-pagination
v-model="page2"
color="teal"
:min="1"
:max="15"
:max-pages="6"
direction-links
/>

With custom interval

<q-pagination
v-model="page3"
:min="5"
:max="10"
/>

Mix and match

<q-pagination
v-model="page4"
color="tertiary"
:min="7"
:max="18"
:max-pages="8"
boundary-links
direction-links
/>