Skip to content

Pagination

Move between pages of a collection.

Demos

Size
Variant

Usage

vue
<script setup lang="ts">
import { Accordion } from '~/components/ui/accordion'

const items = [
  { value: 'source', label: 'Do I own the source?', content: 'Yes. Copy and adapt the files.' },
]
</script>

<template>
  <Accordion :items="items" />
</template>

Selection and movement

Page numbers use equal-width controls and tabular numerals. A separate selection marker stays in place when the visible range shifts; the numbered controls slide to their new positions over 180ms. Reduced motion updates the range immediately.

Previous, next, first, and last controls use chevrons with accessible labels. Custom slots can replace those icons. Larger ranges scroll within their container instead of clipping controls. DataTable uses this same styled pagination and inherits the table size.

Active-page variants

Choose soft (default), solid, subtle, or outline with variant. Each uses the same marker and number movement; the selected page changes its fill, border, and foreground together. Use the preview's variant selector to compare them.

vue
<Pagination v-model="page" :total="100" variant="solid" />
<Pagination v-model="page" :total="100" variant="outline" />

Installation

Complete the shared installation. Copy Pagination.vue and index.ts into app/components/ui/pagination/.

API

Variants and defaults

PropValuesDefault
sizexs, sm, md, lg, xlsm

Props

PropTypeDefaultDescription
variant"soft" | "solid" | "subtle" | "outline""soft"Appearance of the active page marker and label.
totalnumber0Total number of data items.
itemsPerPagenumber10Data items represented by each page.
siblingCountnumber2Visible page numbers on each side of current page.
showEdgesbooleanfalseAlways includes first/last page numbers and ellipses.
showFirstLastbooleanfalseRenders explicit first/last controls.
showPreviousNextbooleantrueRenders previous/next controls.
disabledbooleanfalseDisables all pagination controls.
ariaLabelstring"Pagination"Accessible navigation label.
getPageHref(page) => string | undefined—Renders controls as anchors when an href is returned.
uiPaginationUi—Classes for structural parts.

Slots

SlotPropsDescription
firstdisabledFirst-page control content.
previousdisabledPrevious-page control content.
pagepage, isActiveNumbered page content.
ellipsissideStart/end ellipsis content.
nextdisabledNext-page control content.
lastdisabledLast-page control content.
statepage, pageCount, items, goToPageOptional state-driven custom UI.

Events

EventPayloadDescription
update:modelValuepageFired after an accepted page change.
value-change(page, details)Fired before page change. details.cancel() prevents it.

Keyboard

Pagination uses native buttons or links. Tab moves through enabled controls; Enter and Space activate buttons, and Enter activates links. Boundary controls are disabled and removed from the tab order when they cannot move further.