Skip to main content
You are viewing Pre-Alpha documentation.
Vuetify0 Logo
Mode
Accessibility
Vuetify

usePagination

A lightweight composable for managing pagination state with navigation methods and computed visible page items.

Intermediate99.4% coverageJan 7, 2026

Usage

The usePagination composable provides reactive pagination state management with navigation methods and automatic computation of visible page items with ellipsis support.

ts
import { ref } from 'vue'
import { createPagination } from '@vuetify/v0'

const pagination = createPagination({
  size: 200, // Total items
  itemsPerPage: 10,
  visible: 5,
})

console.log(pagination.pages) // 20 (200 items / 10 per page)
console.log(pagination.items.value)
// [
//   { type: 'page', value: 1 },
//   { type: 'page', value: 2 },
//   { type: 'page', value: 3 },
//   { type: 'ellipsis', value: '…' },
//   { type: 'page', value: 20 }
// ]

Architecture

usePagination computes page state and navigation:

Pagination Flow

Use controls to zoom and pan. Click outside or press Escape to close.

Pagination Flow

API Reference

The following API details are for the usePagination composable.

Functions

createPagination

(_options?: PaginationOptions) => PaginationContext

Creates a pagination instance.

createPaginationContext

(_options?: PaginationContextOptions) => ContextTrinity<PaginationContext>

Creates a pagination context for dependency injection.

usePagination

(namespace?: string) => PaginationContext

Returns the current pagination instance from context.

Options

page

number | ShallowRef<number>

Initial page or ref for v-model (1-indexed).

Default: 1

itemsPerPage

MaybeRefOrGetter<number>

Items per page.

Default: 10

size

MaybeRefOrGetter<number>

Total number of items.

Default: 0

visible

MaybeRefOrGetter<number>

Maximum visible page buttons.

Default: 5

ellipsis

string | false

Ellipsis character.

Default: '…'

Properties

page

ShallowRef<number>

Current page (1-indexed)

itemsPerPage

number

Items per page

size

number

Total number of items

pages

number

Total number of pages (computed from size / itemsPerPage)

ellipsis

string | false

Ellipsis character, or false if disabled

items

ComputedRef<PaginationTicket[]>

Visible page numbers and ellipsis for rendering

pageStart

ComputedRef<number>

Start index of items on current page (0-indexed)

pageStop

ComputedRef<number>

End index of items on current page (exclusive, 0-indexed)

isFirst

ComputedRef<boolean>

Whether current page is the first page

isLast

ComputedRef<boolean>

Whether current page is the last page

Methods

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

(value: number) => void

Go to specific page

Was this page helpful?

© 2016-1970 Vuetify, LLC
Ctrl+/