components / pagination

pagination.

page navigation with boundary pages, a sibling window and ellipsis gaps, plus a compact prev/next variant. the window shifts rather than shrinking at the ends, so the control keeps a constant width as you page through it, and a gap that would elide exactly one page renders that page instead. the range logic ships as a separate tested module.

showing page 1 of 20

installation
bunx @justin06lee/chrome@latest add pagination
props
nametypedefaultdescription
page *number-current page, 1-based.
pageCount *number-total pages; 1 or fewer renders nothing.
onChange *(page: number) => void-
siblingsnumber1pages shown either side of the current one.
boundariesnumber1pages pinned at each end.
compactbooleanfalseprev/next with a '3 / 12' readout instead of numbers.
ariaLabelstring'pagination'
classNamestring-