Skip to content

Pagination

@astryxdesign/core v0.7.1 · Pagination

Usage ​

Pagination splits a long list into pages. People move with the page buttons or the previous and next controls.

Pass the total and bind the current page:

vue
<script setup lang="ts">
import { Pagination } from '@astryx-vue/core/Pagination'
import { ref } from 'vue'

const page = ref(1)
const total = ref(100)
</script>

<template>
  <Pagination v-model:page="page" :total="total" />
</template>

pageSize is how many items each page holds. showSizeChanger lets people change that. showTotal shows how many items exist and which range the current page covers.

The visible labels are English unless the app calls provideAstryxLocale('zh-CN').

Anatomy

ElementDescription
PaginationNavigation landmark containing the current paging controls and optional page-size selector.
Page-size selectorOptional Selector for choosing how many items appear per page.
First/last buttonsOptional Button controls that jump to the first or last known page.
Previous/next buttonsButton controls that move backward or forward through the pages.
Page number buttonButton for one directly selectable page in the numbered presentation.
EllipsisVisual omission marker between non-adjacent page-number buttons.
Count readoutText showing the current item range and total item count.
Compact readoutText showing the current page and total page count.
DotPage indicator control that reflects and changes the active page.
Page input labelLeading visible label for the editable page-number field.
Page inputNumberInput used to enter a page directly.
Page input totalTrailing text showing the known total page count.

Best practices ​

GuidelinePractice
DoUse it under tables and lists that are too long for one page.
DoOffer showSizeChanger when the list is large enough that page length matters.
DoShow the total and the current range so people know how much data there is.
Don'tRely on a long row of page buttons on a narrow screen. Keep the control compact.

Examples ​

Dots carousel

A thorough report was done on our financial situation. Better deals were found and processed on our behalf, which took a lot of stress away.
JG
Jeannie GrantJune 01, 2025

Dot pagination steps through a short set of review cards, where position matters more than a page number.

Page size selector

Transactions

Date
Description
Amount
Apr 18Payment received$2,450.00
Apr 15Subscription renewal$99.00
Apr 12Refund issued-$180.00
Apr 10Invoice paid$1,200.00

Pagination sits under a transactions table, with a control for how many rows each page holds.

With table

Name
Role
Status
Olivia ChenEngineerActive
Marcus RiveraDesignerActive
Aisha PatelMarketingInvited
James OkaforEngineerActive

The count variant under a table, at the small size, shows the item range for the current page.

Page input

Type a page number to jump. First and last sit outside the previous and next buttons. When the total is unknown, pass hasMore instead of a last page.