Skip to content

Pagination ​

Navigate multi-page result sets. Use for tables, lists, and search results — not for scrolling within a single view.

Overview ​

The catnip-pagination custom element offers two layouts from Figma:

LayoutRole
defaultItem range summary (21-30 of 86 items) plus Previous / page numbers / Next
compactFirst / Previous / current page / of N / Next / Last
PropRole
modelValueCurrent page (1-based)
totalPagesTotal pages (optional — derived from totalItems / pageSize when omitted)
totalItems / pageSizeDrive the default-layout range summary
siblingCountPages shown beside the current page in default layout

Controls compose catnip-button (purpose="utility", appearance="ghost"). Selected page uses the button selected state.

Live example ​

Guidelines ​

When to use ​

  • Paginate tables, lists, or search results with a known page count or item total.
  • Prefer default when there is room for a page list and an item-range summary.
  • Prefer compact in narrow toolbars or dense panels (first / previous / current / of N / next / last).

When not to use ​

  • Do not use Pagination for infinite scroll or “load more” — those are different patterns.
  • Do not use Pagination to step a single numeric field — use Number Input.

Composition ​

Bind the current page with .modelValue and @update:modelValue (do not use v-model on the host):

vue
<catnip-pagination
  layout="default"
  .modelValue="page"
  .totalItems="86"
  .pageSize="10"
  @update:modelValue="page = $event.detail[0] ?? $event.detail"
/>

Compact:

vue
<catnip-pagination layout="compact" .modelValue="page" .totalPages="9" @update:modelValue="page = $event.detail[0] ?? $event.detail" />

Single page and empty results ​

Show Pagination only when there is more than one page. When every item fits on one page, or there are no results, leave the component out instead of showing a Previous / 1 / Next row with nothing to navigate. The component does not hide itself, so render it conditionally:

vue
<catnip-pagination
  v-if="totalItems > pageSize"
  layout="default"
  .modelValue="page"
  .totalItems="totalItems"
  .pageSize="pageSize"
  @update:modelValue="page = $event.detail[0] ?? $event.detail"
/>
  • The default layout's range summary goes away with the component. If users need the item count, show it elsewhere, for example next to the table heading.
  • When filtering reduces the results to one page, also reset the current page to 1 so the visible rows are not taken from a page that no longer exists.

Layouts ​

LayoutControls
defaultRange summary · Previous · page numbers (with ellipsis) · Next
compactFirst · Previous · current page · of N · Next · Last

Labels ​

Override previousLabel, nextLabel, ofLabel, itemsLabel, and aria-label props for localization. Page button labels use pageAriaLabel with a {page} placeholder.

Catnip Design System by Signicat