Pagination
NavigationLets users move between numbered pages and see their current position.
Try it
Add to your project
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/pagination.jsonThe command includes the component’s shared dependencies. Your project keeps editable source files.
Include the complete example
This example also composes card. Install its parts together:
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/pagination.json https://luv-jeri.github.io/cojeev-ui/r/card.jsonUsing pagination
Provide totalPages and handle onPageChange to update the displayed records.
Use page for controlled navigation or compose the pagination parts when you need a custom arrangement.
API
Compose the exported parts below. The prop types are read from the React source during the registry build.
Native element or underlying primitive props are inherited where declared, including accessible labels, event handlers and refs.
PaginationProps
| Prop | Type | Required |
|---|---|---|
page | number | No |
defaultPage | number | No |
totalPages | number | No |
onPageChange | (page: number) => void | No |
PaginationContentProps
Accepts the native or primitive props declared by its exported TypeScript type.
PaginationItemProps
Accepts the native or primitive props declared by its exported TypeScript type.
PaginationLinkProps
| Prop | Type | Required |
|---|---|---|
isActive | boolean | No |
PaginationPreviousProps
| Prop | Type | Required |
|---|---|---|
isActive | boolean | No |
PaginationNextProps
| Prop | Type | Required |
|---|---|---|
isActive | boolean | No |
PaginationEllipsisProps
Accepts the native or primitive props declared by its exported TypeScript type.
Accessibility
The built-in controls identify the current page and announce the page count; preserve equivalent names and state in custom compositions.
States and appearance
For conditional content, keep a MotionPresence boundary around keyed MotionSurface children. The shared entrance and exit states work with native primitives and respect your motion preference.
Try pointer and keyboard interaction, and switch the appearance control in the navigation to compare light and dark mode. Motion respects reduced motion preferences.