Skip to content

MazPagination

MazPagination is a standalone component

INFO

Before you have to import the global css files in your project, follow instructions in Getting Started

Basic usage

v-model="1"

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

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

  import { ref } from 'vue'

  const currentPage = ref(1)

  const props: Props = {
    resultsSize: 100,
    totalPages: 10,
    activeColor: 'primary',
  }
</script>

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, Event & Slots

Props

Prop nameDescriptionTypeValuesDefault
modelValue
@model The current page number.
number-1
buttonPropsProps apply to the MazBtn components.Partial-undefined
resultsSizeNumber of results in this page. Useful for accessibility to set aria-setsize attribute. Partial of MazBtn props.number-undefined
activeColorColor of the active button.Color-'primary'
sizeColor of the active button.Size-'md'
totalPagesTotal number of pages.number-
pageRangeNumber of buttons to display before and after the current page.number-2
loadingEnable loading state of current buttonboolean-

Events

Event namePropertiesDescription
update:model-valuevalue number - new page numberEmitted when the current page number is changed.

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