Pagination

Page-by-page navigation for lists, tables, and search results. The VdPagination component renders a numbered control bound via v-model and :total, automatically collapsing long ranges with ellipses and emitting @update:modelValue and a pagination:change event as the user navigates.

Basic

Current page: 1

Sizes
Alignment
Large Sets with Ellipsis

With more than :max-visible pages, the control always shows the first and last page plus a window around the current page, separated by “…”.

Current page: 10

Disabled

Add disabled to make the whole control non-interactive while data is loading.

API Reference

Usage

<script setup lang="ts">
import { VdPagination } from "@vanduo-oss/vd3";
const page = ref(1);
</script>

<template>
  <VdPagination v-model="page" :total="20" :max-visible="7" />
</template>

VdPagination Props & Events

Prop / EventTypeDefaultDescription
v-model (modelValue)number1Two-way bound active page (1-indexed).
:totalnumber—Total number of pages to render.
:maxVisiblenumber7Maximum page buttons shown before collapsing distant ranges to ellipses.
:size"sm" | "md" | "lg""md"Size modifier applied to the pagination list.
:align"left" | "center" | "right""left"Horizontal alignment modifier on the pagination list.
:disabledbooleanfalseDisables all page and previous/next buttons.
@update:modelValue(page: number) => void—Emitted when the user selects a new page.
pagination:changeCustomEvent<{ page: number, totalPages: number }>—Native DOM event bubbling from the pagination root when the page changes.

CSS Classes

ClassDescription
.vd-paginationFlex list container for the pagination items
.vd-pagination-itemAn individual page slot (wraps a link or ellipsis)
.vd-pagination-linkThe clickable anchor inside a page item
.vd-pagination-item.activeThe current page (filled primary colour)
.vd-pagination-item.disabledA non-interactive item (e.g. Previous on page 1)
.vd-pagination-prev / .vd-pagination-nextThe previous / next navigation items
.vd-pagination-ellipsisThe “…” gap shown between distant page ranges
.vd-pagination-sm / .vd-pagination-lgSize modifiers on the container
.vd-pagination-center / .vd-pagination-rightAlignment modifiers on the container

Programmatic Control

Accessibility
  • The control is wrapped in <nav aria-label="Pagination">
  • The active page link carries aria-current="page"
  • Each page link has a descriptive aria-label (e.g. "Page 4")
  • Ellipses use aria-hidden="true" so they are skipped by screen readers
  • Previous / Next become .disabled (and non-interactive) at the range boundaries