Reference headless
pagination
# CalculatePagesInput
Members
boundaryCount?optional boundaryCount?: numberHow many boundary pages at start/end to always show. Default 1.
pagepage: number1-indexed current page.
pageCountpageCount: numbersiblingCount?optional siblingCount?: numberHow many neighbours of the current page to show. Default 1.
# PaginationItemEllipsis
Members
sideside: "start" | "end"Where the gap is — before the central window (
'start') or after ('end').typetype: "ellipsis"
# PaginationItemPage
@kumiki/headless/pagination — page-list math for the Pagination component.
Pagination has no FSM and no DOM behavior beyond native button clicks. The non-trivial part is computing which page numbers to render given page, pageCount, siblingCount, boundaryCount. That math lives here as a pure function so consumers without Svelte (server renderers, tests) can use it directly.
Members
isCurrentisCurrent: booleanpagepage: numbertypetype: "page"
# PaginationItem
PaginationItem = PaginationItemPage | PaginationItemEllipsis# calculatePages ( )
calculatePages(__namedParameters): PaginationItem[]Compute the page-list to render. Inserts ellipses where gaps appear.
``ts calculatePages({ page: 5, pageCount: 20 }) // → [1, …, 4, 5, 6, …, 20] ``
Parameters
\_\_namedParametersCalculatePagesInput
Returns
PaginationItem[]