---
title: "MazPagination"
description: "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"
package: "maz-ui"
url: "https://maz-ui.com/components/maz-pagination"
---

# 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

- Package: `maz-ui`
- Import: `import MazPagination from 'maz-ui/components/MazPagination'`
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
- Web: https://maz-ui.com/components/maz-pagination

> Before use it, you should install the MazUi plugin in your project, follow instructions in [Getting Started](../guide/getting-started.md)

**Tip:**

This component can be translated globally using the [MazUi](https://maz-ui.com/ecosystem/translations.md) plugin.

## Basic usage

`v-model=""`

```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

The page buttons use the neutral `container` color by default (see `color`) and the active page uses `activeColor` (`contrast` by default).

## MazPagination API

`import MazPagination from 'maz-ui/components/MazPagination'`

### Props

- `model-value` (`number`, default: `1`, `v-model`): The current page number.
- `button-props` (`Partial<MazBtnProps>`): Props apply to the MazBtn components.
- `active-color` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent" | "surface" | "container"`, default: `"contrast"`): Color of the active button.
- `size` (`"xs" | "sm" | "md" | "lg" | "xl" | "mini"`, default: `'md'`): Size of the buttons.
- `total-pages` (`number`, required, default: `10`): Total number of pages.
- `page-range` (`number`, default: `1`): Number of buttons to display before and after the current page.
- `loading` (`boolean`, default: `false`): Enable loading state of current button.

### Events

- `@update:model-value` (payload: `value: number`)

### Slots

- `#first-page-sr`: Accessible text for screen reader of the previous page button Bindings: `page: number` (first page number).
- `#previous-page-sr`: Accessible text for screen reader of the first page button Bindings: `page: number` (previous page number).
- `#page-sr`: Accessible text for screen reader of the current page button Bindings: `page: number` (current page number).
- `#next-page-sr`: Accessible text for screen reader of the next page button Bindings: `page: number` (next page number).
- `#last-page-sr`: Accessible text for screen reader of the last page button Bindings: `page: number` (last page number).
