Skip to main content
You are viewing Pre-Alpha documentation.
Vuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

createPagination

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


IntermediateMar 26, 2026

Usage

The createPagination 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

createPagination computes page state and navigation:

Pagination Flow

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

Pagination Flow

Reactivity

Property/MethodReactiveNotes
pageWritableComputedRef, auto-clamps when total pages shrinks
itemsComputed, visible page buttons with ellipsis
pageStartComputed, start index for current page
pageStopComputed, end index for current page
isFirstComputed, true when on first page
isLastComputed, true when on last page
Tip

v-model support Pass a ref as the page option to enable two-way binding with your component’s page state.

API Reference

The following API details are for the createPagination 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> | undefined

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

Default: 1

itemsPerPage

MaybeRefOrGetter<number> | undefined

Items per page.

Default: 10

size

MaybeRefOrGetter<number> | undefined

Total number of items.

Default: 0

visible

MaybeRefOrGetter<number> | undefined

Maximum visible page buttons.

Default: 5

ellipsis

string | false | undefined

Ellipsis character.

Default: '…'

Properties

page

WritableComputedRef<number, number>

Current page (1-indexed, auto-clamped to total pages)

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

Readonly<Ref<number, number>>

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

pageStop

Readonly<Ref<number, number>>

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

isFirst

Readonly<Ref<boolean, boolean>>

Whether current page is the first page

isLast

Readonly<Ref<boolean, 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+/