Pagination
A component for navigating through a series of related content across multiple pages.
Props
Prop | Type | Default | Description |
|---|---|---|---|
currentPage | number | 1 | The currently active page. Supports $bindable. |
totalPages | number | 1 | The total number of pages. |
onPageChange | (page: number) => Promise<void> | undefined | Async callback triggered when the page changes. |
variant | string | '' | Custom variant class for theming. |
componentId | string | crypto.randomUUID() | The unique identifier for the component wrapper. |
Samples
Pagination Samples
A component for navigating through a series of related content across multiple pages.
1. Basic Pagination
Standard pagination with page numbers and navigation buttons.
Current Page: 1
0
<script>1
import { Pagination } from 'fluid-ui-svelte/components';2
3
let currentPage = $state(1);4
</script>5
6
<Pagination 7
bind:currentPage 8
totalPages={10} 9
onPageChange={async (page) => {10
console.log('Page changed to:', page);11
}}12
/>