Component

Vue Pagination Component

<DomPagination>

A controlled page navigator for data grids, audit logs, search results, and resource lists.

Pagination

DomPagination keeps page selection controlled by the application. Bind v-model:page, provide total and pageSize, and fetch records when the page changes. If the API supplies a page count directly, use pageCount instead.

Large datasets

Use variant="input" for database tables and other views with hundreds or thousands of pages. It shows an editable Page X of Y field with Go and previous/next controls. First/last controls also appear on larger screens; compact hides them at every size.

Typing and leaving the field do not navigate. Press Enter or choose Go to commit a whole number between 1 and the page count. Invalid entries show an error without requesting data. Escape restores the current page.

The field shares the number input's drag handle, focused mouse-wheel adjustment and arrow-key stepping. These adjust the draft only; Enter or Go still commits the page. Hold Shift to adjust ten pages at a time. Mouse adjustments stop at the first and last page, while invalid typed values retain the validation above.

Conversation history

5,218 conversations · 25 rows per page

Numbered navigation

Click the dots to choose a page, or drag them and release to jump. Hold Shift to move faster.

Numbered pages

The default variant="pages" shows the current page, its neighbours and the first/last page numbers. siblingCount and boundaryCount control that window. Each ellipsis opens a small Go to page popover instead of listing every omitted page. Both ellipses accept any page in the dataset.

You can also drag the dots horizontally. The dots preview a number within their omitted range; releasing the mouse navigates to that page once. Dragging left decreases and right increases; Shift speeds up by ten. Escape cancels. The left gap starts at its nearest page before the current selection, and the right gap starts at its nearest page after it. A simple click still opens the popover. Touch gestures keep their normal scrolling behavior.

Opening the popover focuses and selects the page number. Escape dismisses it and restores trigger focus; a successful jump focuses the current page button. The popover stays within the viewport. On narrow containers, the numbered strip can scroll horizontally; use the input variant for a more compact footer.

Customers

Page state can be sent beside grid filters, sort, and search.

offset 75 / limit 25

Application ownership

The component emits update:page and page-change only for a different valid page. It does not fetch data. Use disabled while navigation is unavailable. The page-change payload contains page, previousPage and pageCount.

Keep the rows-per-page selector in the application. When filters, page size or the dataset change, update the controlled page as appropriate, usually to 1. The component bounds its displayed page to the available range without emitting an unsolicited request; the application must reconcile its own query state.

compact retains its existing meaning: hide first/last arrow buttons. It does not select the input variant. activeStyle applies to numbered page buttons.

Playground

Try every prop live

Pagination playground

Keep page state in the parent, then send it with your resource query.

Playground.vuevue
Install
npm install @getdom/studio
vue
<script setup>
import '@getdom/studio/style.css';
import { reactive } from 'vue';
import { DomPagination } from '@getdom/studio';

const data = reactive({
		"page": 4,
		"pageSize": 25,
		"total": 286,
		"pageCount": null,
		"variant": "pages",
		"siblingCount": 1,
		"boundaryCount": 1,
		"disabled": false,
		"compact": false,
		"label": "Pagination",
		"activeStyle": "secondary"
	});
</script>

<template>
	<DomPagination
		v-bind="data"
	/>
</template>

Reference

Props

Control props

NameTypeTSDefaultDescription
pagenumbernumber1Current 1-based page.
pageSizenumbernumber25Rows or items per page.
totalnumbernumber0Total available items.
pageCountnumbernumber—Explicit total page count. Overrides total/pageSize when provided.
variant'pages' | 'input'string'pages'Numbered page buttons with jump popovers, or a compact editable Page X of Y control for large datasets.
siblingCountnumbernumber1Pages to show around the current page.
boundaryCountnumbernumber1Pages to show at the beginning and end.
disabledbooleanbooleanfalseDisable pagination controls.
compactbooleanbooleanfalseHide first and last buttons. The input variant also hides them on small screens.
labelstringstring'Pagination'Navigation landmark label.
activeStyle'secondary' | 'primary'string'secondary'Visual style for the current page. Use primary to restore the stronger selected treatment.

Auto-generated from Pagination.props and inline _edit hints.

Events

NamePayloadDescription
@update:pagenumberFired when the selected page changes.
@page-change{ page, previousPage, pageCount }Fired with page transition metadata.

Names auto-detected from defineEmits and source emit() calls; payload and description from __doc.events when present.

Keyboard

  • Tab / Shift+TabMove between navigation buttons, the page field, and Go.
  • Enter / SpaceActivate a page button or open a Go to page popover.
  • Enter in page fieldNavigate to a valid page. Typing and blur do not navigate.
  • EscCancel a page edit or close the popover and return focus to its trigger.
  • Drag ellipsis / Shift + dragPreview pages within the omitted range; release to navigate once. Shift moves ten pages per step; Escape cancels.
  • Focused wheel / ArrowUp / ArrowDownAdjust the page draft within its bounds. Enter or Go commits it.