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#

TSX
import { Pagination } from '@sigx/daisyui';

Basic Usage#

currentPage is controlled: keep it in a signal and update it from onChange.

TSX
Loading preview...

Many Pages#

With more than seven pages the row collapses around the current page.

TSX
Loading preview...

Paging a List#

TSX
Loading preview...

Props#

PropTypeDefaultDescription
currentPagenumber-The active page (1-based)
totalPagesnumber-Total number of pages
classstring-Additional CSS classes on the join wrapper

Events#

EventTypeDescription
onChange(page: number) => voidFired with the page number when a page button is clicked