Skip to content

MazPagination ​

MazPagination lets users navigate between the pages of a list or a table, with first, previous, next and last buttons and the current page in v-model

Before use it, you should install the MazUi plugin in your project, follow instructions in Getting Started

TIP

This component can be translated globally using the MazUi plugin.

Basic usage ​

v-model="1"

vue
<script lang="ts" setup>
import { MazPagination, type MazPaginationProps } from 'maz-ui/components'

import { ref } from 'vue'

const currentPage = ref(1)

const props: MazPaginationProps = {
  totalPages: 10,
  activeColor: 'contrast',
}
</script>

<template>
  <MazPagination v-bind="props" v-model="currentPage" size="md" />
</template>

Sizes ​

html
<MazPagination v-bind="props" v-model="currentPage" size="xs" />
<MazPagination v-bind="props" v-model="currentPage" size="sm" />
<MazPagination v-bind="props" v-model="currentPage" size="md" />
<MazPagination v-bind="props" v-model="currentPage" size="lg" />
<MazPagination v-bind="props" v-model="currentPage" size="xl" />

Colors ​

Props ​

NameDescriptionTypeRequiredDefaultPossible values
model-valuev-model The current page number.numberNo1-
button-propsProps apply to the MazBtn components.Partial<MazBtnProps>No--
active-colorColor of the active button."primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent" | "surface"No"surface"'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'destructive' | 'contrast' | 'transparent' | 'surface'
sizeSize of the buttons."xs" | "sm" | "md" | "lg" | "xl" | "mini"No'md''xs' | 'sm' | 'md' | 'lg' | 'xl' | 'mini'
total-pagesTotal number of pages.numberYes10-
page-rangeNumber of buttons to display before and after the current page.numberNo1-
loadingEnable loading state of current buttonbooleanNofalse-

Events ​

Event namePayloadDescription
update:model-valuevalue: number

Slots ​

NameDescriptionBindings
first-page-srAccessible text for screen reader of the previous page buttonpage number - first page number
previous-page-srAccessible text for screen reader of the first page buttonpage number - previous page number
page-srAccessible text for screen reader of the current page buttonpage number - current page number
next-page-srAccessible text for screen reader of the next page buttonpage number - next page number
last-page-srAccessible text for screen reader of the last page buttonpage number - last page number