Skip to content

MazPagination

MazPagination is a standalone component

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>Noundefined-
active-colorColor of the active button.MazColor | "background"Nocontrastcontrast', 'primary', 'secondary', 'info', 'success', 'warning', 'destructive', 'accent', 'background
sizeSize of the buttons.MazSizeNomdmini', 'xs', 'sm', 'md', 'lg', 'xl
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-

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