Skip to main content

Overview

Pagination provides navigation controls for paginated data with automatic calculation of visible page buttons based on container width. It supports first/prev/next/last navigation and automatically disables buttons when appropriate.

Sub-Components

  • Pagination.Root: Container that manages pagination state
  • Pagination.Item: Individual page button
  • Pagination.First: Jump to first page
  • Pagination.Prev: Go to previous page
  • Pagination.Next: Go to next page
  • Pagination.Last: Jump to last page
  • Pagination.Ellipsis: Visual indicator for omitted pages
  • Pagination.Status: Screen reader announcements for page changes

Usage

<script lang="ts" setup>
import { ref } from 'vue'
import { Pagination } from '@vuetify/v0'

const page = ref(1)
</script>

<template>
  <Pagination.Root v-model="page" :size="100">
    <Pagination.First />
    <Pagination.Prev />

    <template v-for="item in items" :key="item.value">
      <Pagination.Item v-if="item.type === 'page'" :value="item.value" />
      <Pagination.Ellipsis v-else />
    </template>

    <Pagination.Next />
    <Pagination.Last />
  </Pagination.Root>
</template>

Pagination.Root

Props

as
DOMElement | null
default:"'nav'"
The HTML element to render as
namespace
string
default:"'v0:pagination'"
Namespace for dependency injection
size
number
default:"1"
Total number of items
totalVisible
number
Number of visible page buttons. If undefined, auto-calculates based on container width
itemsPerPage
number
default:"10"
Number of items per page
ellipsis
string | false
default:"'...'"
Ellipsis character

Model

v-model
number
default:"1"
Current page (1-indexed)

Slot Props

page
number
Current page (1-indexed)
size
number
Total number of items
pages
number
Total number of pages
itemsPerPage
number
Items per page
items
PaginationTicket[]
Visible page items for rendering
pageStart
number
Start index of items on current page (0-indexed)
pageStop
number
End index of items on current page (exclusive)
isFirst
boolean
Whether on first page
isLast
boolean
Whether on last page
first
() => void
Go to first page
last
() => void
Go to last page
next
() => void
Go to next page
prev
() => void
Go to previous page
select
(page: number) => void
Go to specific page

Pagination.Item

Props

as
DOMElement | null
default:"'button'"
The HTML element to render as
value
number
Page number this item represents

Slot Props

value
number
Page number
isSelected
boolean
Whether this page is currently selected
select
() => void
Select this page
attrs
object
Attributes including aria-label and aria-current

Pagination.First

Props

as
DOMElement | null
default:"'button'"
The HTML element to render as

Slot Props

isDisabled
boolean
Whether this button is disabled (on first page)
first
() => void
Go to first page
attrs
object
Attributes including data-disabled, aria-label, and type

Pagination.Prev

Props

as
DOMElement | null
default:"'button'"
The HTML element to render as

Slot Props

isDisabled
boolean
Whether this button is disabled (on first page)
prev
() => void
Go to previous page
attrs
object
Attributes including data-disabled, aria-label, and type

Pagination.Next

Props

as
DOMElement | null
default:"'button'"
The HTML element to render as

Slot Props

isDisabled
boolean
Whether this button is disabled (on last page)
next
() => void
Go to next page
attrs
object
Attributes including data-disabled, aria-label, and type

Pagination.Last

Props

as
DOMElement | null
default:"'button'"
The HTML element to render as

Slot Props

isDisabled
boolean
Whether this button is disabled (on last page)
last
() => void
Go to last page
attrs
object
Attributes including data-disabled, aria-label, and type

Pagination.Ellipsis

Props

as
DOMElement | null
default:"'span'"
The HTML element to render as
ellipsis
string
Override ellipsis character from Root

Slot Props

ellipsis
string
The ellipsis character to display

Pagination.Status

Props

as
DOMElement | null
default:"'div'"
The HTML element to render as

Slot Props

message
string
Screen reader announcement message

Examples

<script setup>
import { ref } from 'vue'
import { Pagination } from '@vuetify/v0'

const page = ref(1)
</script>

<template>
  <Pagination.Root v-model="page" :size="100">
    <Pagination.Prev>Prev</Pagination.Prev>

    <template v-for="item in items" :key="item.value">
      <Pagination.Item v-if="item.type === 'page'" :value="item.value">
        {{ item.value }}
      </Pagination.Item>
      <Pagination.Ellipsis v-else />
    </template>

    <Pagination.Next>Next</Pagination.Next>
  </Pagination.Root>
</template>

Accessibility

  • Root renders as <nav> by default with aria-label="Pagination"
  • Items have aria-label describing the page number
  • Current page has aria-current="page"
  • Navigation buttons have descriptive aria-label attributes
  • Disabled buttons have data-disabled attribute
  • Status component provides live region for screen reader announcements
<template>
  <Pagination.Root v-model="page" :size="100">
    <Pagination.Status class="sr-only" />
    <!-- pagination items -->
  </Pagination.Root>
</template>

Build docs developers (and LLMs) love