Skip to content

OrigamPagination ​

<OrigamPagination> renders a navigation strip of page buttons with optional first/last shortcuts and ellipsis truncation.

Basic usage ​

vue
<template>
    <OrigamPagination v-model="page" :length="20" />
</template>

<script setup>
import { ref } from 'vue'
const page = ref(1)
</script>

Length and visible range ​

vue
<template>
    <OrigamPagination v-model="page" :length="100" :total-visible="7" />
</template>
PropTypeDefaultDescription
modelValuenumberundefinedActive page (1-based)
lengthnumber | stringundefinedTotal number of pages
totalVisiblenumber | stringundefinedMax visible page buttons (auto-fills with ellipsis)
startnumber1First page number. Also used as the fallback initial active page when modelValue is omitted in uncontrolled mode — since start itself defaults to 1, a consumer passing neither prop still gets page 1 highlighted.

First / last page shortcuts ​

vue
<template>
    <OrigamPagination v-model="page" :length="20" show-first-last-page />
</template>
PropTypeDefaultDescription
showFirstLastPagebooleanfalseShow first and last page buttons
firstIconTIcon—Icon for the first-page button
lastIconTIcon—Icon for the last-page button
prevIconTIcon—Icon for the previous-page button
nextIconTIcon—Icon for the next-page button
ellipsisstring'...'Text used for gap placeholders

States ​

PropTypeDescription
disabledbooleanDisable all buttons

Compact mode ​

vue
<template>
    <OrigamPagination v-model="page" :length="20" compact />
</template>
PropTypeDefaultDescription
compactbooleanfalseCollapses the page list to a single editable page number ({page} / {length}) instead of one button per page
pageTextstringorigam.pagination.pageLocale key (or literal text) for the compact-mode label
ofTextstringorigam.pagination.ofLocale key (or literal text) for the compact-mode separator ("of")
pageNumberAriaLabelstringorigam.pagination.aria_label.page_numberaria-label for the compact-mode page number <input>

With info ​

vue
<template>
    <OrigamPagination v-model="page" :length="10" with-info :total="100" :per-page="10" />
</template>
PropTypeDefaultDescription
withInfobooleanfalseRenders a left-side range label (Showing {start}-{end} of {total}) next to the page buttons
totalnumber | stringlength * perPageTotal number of items (not pages) the range label is computed from
perPagenumber | string10Items per page, used with total to compute the range
infoTextstringorigam.pagination.infoLocale key for the range label. Receives {0}=start, {1}=end, {2}=total
previousTextstringorigam.pagination.previousLabel next to the prev chevron in withInfo mode
nextTextstringorigam.pagination.nextLabel next to the next chevron in withInfo mode

Polymorphic root ​

PropTypeDefaultDescription
tagstring'nav'Element (or component) the root renders as

ARIA ​

Every prop below carries a locale key, not finished text — its default is a origam.pagination.aria_label.* entry, and the component resolves it through t() before it reaches the DOM. Pass your own key to translate; literal text also works, since an unknown key is returned unchanged.

PropTypeDefault keyDescription
ariaLabelstringorigam.pagination.aria_label.rootaria-label on the <nav> element
pageAriaLabelstringorigam.pagination.aria_label.pageTemplate for each page button ({0} = page number)
currentPageAriaLabelstringorigam.pagination.aria_label.current_pageTemplate for the active page button
firstAriaLabelstringorigam.pagination.aria_label.firstFirst-page button ARIA label
previousAriaLabelstringorigam.pagination.aria_label.previousPrevious-page button ARIA label
nextAriaLabelstringorigam.pagination.aria_label.nextNext-page button ARIA label
lastAriaLabelstringorigam.pagination.aria_label.lastLast-page button ARIA label

Slots ​

SlotBindingsDescription
info{ start, end, total }Custom range label in withInfo mode
firstbutton propsCustom first-page button
prevbutton propsCustom previous-page button
nextbutton propsCustom next-page button
lastbutton propsCustom last-page button
item—Custom page button
item-{key}—Custom button for a specific page key

Emits ​

EventPayloadDescription
update:modelValuenumberActive page changed
firstnumberThe first-page button was clicked (payload is start)
prevnumberThe previous-page button was clicked (payload is page - 1)
nextnumberThe next-page button was clicked (payload is page + 1)
lastnumberThe last-page button was clicked (payload is start + length - 1)

Design tokens ​

TokenDescription
--origam-pagination---*Component-level token namespace