createPagination API
API reference for the createPagination composable.
Explore these related pages for additional context and usage patterns.
(_options?: PaginationOptions) => PaginationContextCreates a pagination instance.
(_options?: PaginationContextOptions) => ContextTrinity<PaginationContext>Creates a pagination context for dependency injection.
(namespace?: string) => PaginationContextReturns the current pagination instance from context.
number | ShallowRef<number> | undefinedInitial page or ref for v-model (1-indexed).
Default: 1
MaybeRefOrGetter<number> | undefinedItems per page.
Default: 10
MaybeRefOrGetter<number> | undefinedTotal number of items.
Default: 0
MaybeRefOrGetter<number> | undefinedMaximum visible page buttons.
Default: 5
string | false | undefinedEllipsis character.
Default: '…'
WritableComputedRef<number, number>Current page (1-indexed, auto-clamped to total pages)
numberTotal number of items
numberTotal number of pages (computed from size / itemsPerPage)
string | falseEllipsis character, or false if disabled
ComputedRef<PaginationTicket[]>Visible page numbers and ellipsis for rendering
Readonly<Ref<number, number>>Start index of items on current page (0-indexed)
Readonly<Ref<number, number>>End index of items on current page (exclusive, 0-indexed)
Readonly<Ref<boolean, boolean>>Whether current page is the first page
Readonly<Ref<boolean, boolean>>Whether current page is the last page
() => voidGo to first page
() => voidGo to last page
() => voidGo to next page
() => voidGo to previous page
(value: number) => voidGo to specific page