Component
Pagination
<DomPagination>A controlled page navigator for data grids, audit logs, search results, and resource lists.
Playground
Try every prop live
Pagination playground
Keep page state in the parent, then send it with your resource query.
Playground.vuevue
<script setup>
import { reactive } from 'vue';
import { DomPagination } from '@getdom/studio/vue';
const data = reactive({
"page": 4,
"pageSize": 25,
"total": 286,
"pageCount": null,
"siblingCount": 1,
"boundaryCount": 1,
"disabled": false,
"compact": false,
"label": "Pagination",
"activeStyle": "secondary"
});
</script>
<template>
<DomPagination
v-bind="data"
/>
</template>Demo
Resource page navigation
Use DomPagination beside data grids, audit logs, search results, and API-backed resource lists.
Customers
Page state can be sent beside grid filters, sort, and search.
offset 75 / limit 25<script setup>
import { computed, ref } from 'vue';
import { DomPagination } from '../../../lib/vue';
const page = ref(4);
const pageSize = 25;
const total = 286;
const queryPayload = computed(() => ({
page: page.value,
pageSize,
offset: (page.value - 1) * pageSize,
limit: pageSize,
}));
</script>
<template>
<div class="w-full max-w-3xl rounded-lg border border-border bg-canvas p-5 shadow-sm">
<div class="flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between">
<div>
<p class="text-sm font-semibold text-canvas-fg">Customers</p>
<p class="mt-1 text-sm text-muted-fg">Page state can be sent beside grid filters, sort, and search.</p>
</div>
<code class="rounded-md bg-secondary px-2 py-1 text-xs text-muted-fg">
offset {{ queryPayload.offset }} / limit {{ queryPayload.limit }}
</code>
</div>
<div class="mt-5 rounded-md border border-border bg-secondary/40 p-4">
<div class="grid gap-2">
<div v-for="index in 4" :key="index" class="h-10 rounded-md bg-canvas shadow-sm"></div>
</div>
</div>
<DomPagination
v-model:page="page"
class="mt-5"
:page-size="pageSize"
:total="total"
/>
</div>
</template>
Reference
Props
Control props
| Name | Type | TS | Default | Description |
|---|---|---|---|---|
page | number | number | 1 | Current 1-based page. |
pageSize | number | number | 25 | Rows or items per page. |
total | number | number | 0 | Total available items. |
pageCount | number | number | — | Explicit total page count. Overrides total/pageSize when provided. |
siblingCount | number | number | 1 | Pages to show around the current page. |
boundaryCount | number | number | 1 | Pages to show at the beginning and end. |
disabled | boolean | boolean | false | Disable pagination controls. |
compact | boolean | boolean | false | Hide first and last buttons. |
label | string | string | '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
| Name | Payload | Description |
|---|---|---|
| @update:page | number | Fired 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.