No detours
With classic pagination, getting from page 1 to page 50 means clicking through the pages in between, and each one loads. Here you swipe to page 50 and tap it once.
Vanilla JS · React · Vue · Svelte
One responsive line of page numbers that you scroll instead of step through. Jump from page 1 to page 3,000 with a flick, never wrap onto a second line, and render only the numbers on screen.
npm i swipe-pagination
Swipe or drag-scroll the numbers, tap the arrows (tap them fast), or tab in and use ← → Home End.
With classic pagination, getting from page 1 to page 50 means clicking through the pages in between, and each one loads. Here you swipe to page 50 and tap it once.
Once pages reach the thousands, the buttons get wide and wrap onto a second line on phones. Every page lives in one scroll area, so the strip stays on one line even at 320px. Widen it and you just see more pages.
Rendering 5,000 buttons freezes the page. Only the visible numbers are rendered, and each number is only as wide as its digits, so no space is wasted.
Drag the handle at the bottom-right of the box to resize it. Every control maps to an option or method.
Every theme reads its UI library's CSS variables, so your brand colors, radius and dark mode carry over. Import
one file. For utility-first CSS such as Tailwind, pass classNames instead.
The built-in classes are always present. Strings in classNames are appended, so they add to the
styling and never replace the layout.
9 × w₁ + 5 × w₂. The inverse turns a scroll position back into a page.