shadcn.io is not affiliated with official shadcn/ui
Components
Free
Pagination for Svelte
Links for previous, page numbers, and next on a long list, with the current page marked. For Svelte with Ark UI, when the list does not fit in one view.
Framework
UI library
Page numbers, with previous and next, sit under a long list. The current page is marked.
Use it when a collection doesn't fit in one view. The path through the site is a Breadcrumb, not more pages of the same list. In Svelte, Ark UI renders a navigation landmark, and each page should keep its own address.
Installation
Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.
Five page links and nothing else, with the current one marked isActive. Use a numbers-only row when there are few pages and a previous or next control would only widen it. Once the list runs long, add those ends and an ellipsis, which is the opening preview. isActive is also how assistive tech knows which page is current.
Icons Only
Previous and next, with no numbers, beside a rows-per-page Select. That is the compact footer of a data table, where stepping matters more than jumping. Use it when the table already shows a range and numbered links would repeat it. Keep the numbers when someone may need a far page, because stepping one page at a time is a poor way to get there.
Rtl
dir="rtl" flips the row, and text on previous and next replaces the English words with Arabic labels. The arrows follow the reading order, so previous stays at the start. Pass text whenever the visible word is not the default, because that string is also the accessible name. Numbers in the same script belong in this row too.
FAQ
How do I track the current page with the Ark UI Pagination?
Pass count, the total number of items, and Pagination keeps the page itself: PaginationItems renders the numbers and ellipses, and Previous and Next disable at the ends. Control it with page and onPageChange, and set pageSize (10 by default).
How do I use Next.js Link or my router with Pagination in Svelte?
Keep a real URL per page, so people can bookmark page 12 and search engines can follow it.
SvelteKit routes plain links, so href on PaginationLink is enough.
How do I show an ellipsis when Pagination has many pages?
With count, siblingCount sets how many pages show beside the current one and boundaryCount how many at each end; PaginationItems fills each gap with PaginationEllipsis.
Why can I still click Previous on the first page?
Without count, Pagination is a plain row of links and doesn't know where it stands. Pass count and Previous and Next disable themselves at the ends, or leave PaginationPrevious out on page 1 and PaginationNext out on the last page.
How do I show only Previous and Next buttons in Pagination?
Leave out the numbered PaginationLinks and keep PaginationPrevious and PaginationNext. The Icons Only demo above does that, with a rows-per-page Select beside them.
How do I change or translate the Pagination labels?
Pass text on PaginationPrevious and PaginationNext ("Previous" and "Next" by default). For a right-to-left language, set the direction too, as in the RTL demo, so the row and its arrows follow the reading order.
Is the Ark UI Pagination accessible?
Yes. It renders a nav landmark labeled "pagination", Previous and Next carry labels for screen readers, and the current page's link gets aria-current="page", so assistive tech announces where you are.
How do I install Pagination in Svelte?
Run the command from the Installation section above: it adds Pagination and the button it uses to your project's ui folder.
shadcn-svelte writes a pagination folder of parts, which you own and can edit.
API Reference
Pagination
<nav>data-slot="pagination"
PropType
page?number
The controlled active page.
defaultPage?number
The initial active page when rendered.
Use when you don't need to control the active page of the pagination.
Default
1
onPageChange?(details: PageChangeDetails) → void
Called when the page number is changed.
Type
(details: PageChangeDetails) → void
Parameters
details – { page: number; pageSize: number }
Returns
void
pageSize?number
The controlled number of data items per page.
defaultPageSize?number
The initial number of data items per page when rendered.
Use when you don't need to control the page size of the pagination.