Data
Paginator
Moves through pages of data, with first, previous, numbered, next and last buttons, and a rows-per-page choice.
WAI-ARIA tested
Import
main.ts
import { Paginator } from '@vitral/vue';Basic
120 records, ten per page, with a choice of page size.
first = 0, rows = 10
Current page report
The report follows the locale (`pageReport`); a template of your own can say it differently.
Start and end content
API
Read from packages/vue/src/components/Paginator/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| totalRecords | number | Rows in the whole data, across pages. |
| rowsPerPageOptions | number[] | Choices for the rows-per-page select; it is left out without them. |
| pageLinkSize | number | How many page links to show around the current one. |
| template | PaginatorTemplateItem[] | string | The pieces to render, in order: a list, or a space-separated string. |
| currentPageReportTemplate | string | `{first}`, `{last}`, `{total}`, `{page}`, `{pageCount}`, `{rows}`. Defaults to the locale's `pageReport`. |
| alwaysShow | boolean | Render even when everything fits on one page. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| page | event: PaginatorPageEvent | — |
Slots
| Name | Slot props | Description |
|---|---|---|
| start | (props: PaginatorPageEvent) | Content before the controls: a summary, an export button. |
| end | (props: PaginatorPageEvent) | Content after the controls. |