Pagination
Pagination renders page-number buttons as a joined button group. Up to seven
pages are shown in full; beyond that the component keeps the first and last
page, the current page and its neighbours, and collapses the rest into ....
Import
import { Pagination } from '@sigx/daisyui';
Basic Usage
currentPage is controlled: keep it in a signal and update it from onChange.
Loading preview...
Many Pages
With more than seven pages the row collapses around the current page.
Loading preview...
Paging a List
Loading preview...
Props
| Prop | Type | Default | Description |
|---|---|---|---|
currentPage | number | - | The active page (1-based) |
totalPages | number | - | Total number of pages |
class | string | - | Additional CSS classes on the join wrapper |
Events
| Event | Type | Description |
|---|---|---|
onChange | (page: number) => void | Fired with the page number when a page button is clicked |
