Navigation Core Stable

Pagination

A page-number control with Previous/Next, ellipsis collapsing for long runs, and optional First/Last jump buttons.

Preview

Installation

pnpm add fancy-ui-svelte
import { Pagination } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { Pagination } from 'fancy-ui-svelte';
</script>

<Pagination />

Examples

Basic Usage

Many Pages

A 200-page run — the sequence stays a handful of numbers plus two ellipses.

With First/Last

First/Last jump buttons alongside Previous/Next.

Disabled State

Props

PropTypeDefaultDescription
page number1Current page, 1-based. Bindable.
count *number-Total number of pages.
onPageChange (page: number) => void-Called with the new page whenever it changes, however the change happened.
siblingCount number1Pages shown on each side of the current page.
boundaryCount number1Pages always shown at each end of the run.
showEdges booleanfalseShows First/Last jump buttons alongside Previous/Next.
disabled booleanfalseDisables every control in the nav.
label string"Pagination"Accessible name for the nav landmark.
class string-Additional CSS classes, merged onto the nav element.
ref HTMLElement | nullnullBindable reference to the nav element.

Slots

SlotDescription
previousLabelOverrides the Previous button's content.
nextLabelOverrides the Next button's content.