WlPagination
Limits
Page 1 of 12
Full example
<div class="wl-stack" data-space="md">
<WlPagination v-model:page="page" :page-count="12" />
<p class="wl-text-small" role="status">{{ "Page" }} {{ page }} {{ "of 12" }}</p>
</div>Appearance
Page 1 of 12
Full example
<div class="wl-stack" data-space="md">
<WlPagination v-model:page="page" :page-count="12" />
<p class="wl-text-small" role="status">{{ "Page" }} {{ page }} {{ "of 12" }}</p>
</div>Page list and compact input
Ellipses, two named navigation regions, Enter/blur for compact page numbers and disabled.
Default: 6 of 12. Compact: 2 of 9.
The compact field applies the page number on Enter or blur. The value is clamped to the available range.
Full example
<script setup lang="ts">
import { WlCheckbox, WlPagination } from "legato-ui";
import { ref } from "vue";
const page = ref(6);
const compactPage = ref(2);
const disabled = ref(false);
</script>
<template>
<div class="wl-stack" data-space="lg">
<WlCheckbox v-model="disabled">{{ "Disable page navigation" }}</WlCheckbox>
<WlPagination
v-model:page="page"
:page-count="12"
:siblings="1"
:disabled="disabled"
:pt="{ root: { 'aria-label': 'Material pages' } }"
/>
<WlPagination
v-model:page="compactPage"
:page-count="9"
compact
:disabled="disabled"
:pt="{ root: { 'aria-label': 'Compact material pages' } }"
/>
<p class="wl-text-small" role="status">
{{ "Default:" }} {{ page }} {{ "of 12. Compact:" }}
{{ compactPage }} {{ "of 9." }}
</p>
<p class="wl-text-small wl-text-muted">{{ "The compact field applies the page number on Enter or blur. The value is clamped to the available range." }}</p>
</div>
</template>Props
Types, accepted values and literal defaults come from the public manifest. Inherited settings name their source; “Not set” means no default is declared.
| Prop | Type / values | Default | Purpose |
|---|---|---|---|
page | number | 1 | Current page number, starting at 1. |
pageCount * | number | Required | Total pages. |
siblings | number | 1 | Number of pages shown around the current page. |
compact | boolean | false | Compact view with an input. |
disabled | boolean | false | Disables navigation. |
pt | WlPt< | Not set | Attributes of internal Legato UI elements. |
pageSize | number | Not set | Number of rows displayed on a page. |
pageSizes | readonly number[] | Not set | Available page-size choices. |
total | number | Not set | Total number of data rows used to calculate pagination. |
Events
| Event | Payload | When emitted |
|---|---|---|
update:page | [value: number] | New page number, starting at 1. |
update:pageSize | [value: number] | Requests a new page size selected by the user. |
Slots
No public slots.
Pass-through: pt
Sections WlPagination are listed below. Attributes merge in this order: createWlPt() WlConfig.ptpt instance. Class and style merge; the last supplied value takes priority for other attributes.
| Section | DOM | Purpose |
|---|---|---|
root | nav.wl-pagination | The root section in WlConfig.pt.pagination configuration. |
Sections refer to the component DOM. Dotted names identify a configuration group and its section; composite parts use their own pt groups. Global and local attributes merge, with class and style added together.
Keyboard and accessibility
- Page numbering starts at 1; the current button gets aria-current=page.
- Regular buttons support keyboard control and have accessible navigation labels. Compact input applies the number on Enter or blur.
- Disabled blocks buttons and input. Give multiple paginators different pt.root aria-label values and show the page number/total in text.
Keyboard and application responsibilities
| Key | Action |
|---|---|
| Tab / Shift+Tab | Move between enabled links, actions and form controls. |
| Enter / Space | Activate native actions; links follow with Enter. |
Provide a meaningful accessible name and connect labels, hints and errors to the focusable element. Check the behavior with your own data and a screen reader.
WAI-ARIA Authoring PracticesIn your application, check keyboard controls, zoom and focus visibility. State labels and required information must be readable in every theme.