Skip to content
Browse docs and components

Pagination

pagination

Page links rendered on the server, with the ends always reachable and a gap only where it hides more than one page. Previous and next hold their place on the first and last page, so nothing shifts as you click through.

Responsive

Install

$npxshadcnadd@forme/pagination

Adds the component, its registry dependencies, and the token stylesheet you import once.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

Pagination

Pagination as links, rendered on the server.

PropTypeDefaultDescription
page*number—
pageCount*number—
hrefFor*(page: number) => string—Builds the link for a page. Links rather than callbacks, so every page is shareable.
siblingsnumber1Pages shown either side of the current one before collapsing into an ellipsis.

Also takes every prop of <nav> attributes.