115 Components
Pagination
NavigationKinetic spring-animated pagination component featuring a sliding active selection capsule, smart ellipsis windowing, jump-to-page input, and full arrow-key keyboard navigation.
NewSpring PhysicsShared LayoutWAI-ARIA
Installation
Install directly into your project using the shadcn CLI or copy the source code manually.
Requires:framer-motionlucide-reactclsxtailwind-merge
$npx shadcn@latest add "https://boseui.site/r/pagination.json"
Props
TypeScript props supported by <Pagination />.
| Prop | Type | Default | Description |
|---|---|---|---|
| totalPages | number | 10 | Total number of pages available. |
| currentPage | number | 1 | Controlled current active page number (1-indexed). |
| siblingCount | number | 1 | Number of page buttons displayed on each side of the active page. |
| showControls | boolean | true | Whether to render previous and next chevron buttons. |
| showEdgeControls | boolean | true | Whether to render first and last skip buttons. |
| showQuickJumper | boolean | false | Whether to display the direct page jump numeric input. |
| onPageChange | (page: number) => void | — | Callback invoked whenever the active page changes. |
Key Features
- Shared layoutId active selection pill that fluidly glides across page numbers with spring physics.
- Smart ellipsis windowing with interactive fast-forward / rewind preview buttons.
- First, previous, next, and last page skip controls with disabled tactile states.
- Optional direct jump-to-page input with boundary validation.
- Optional total items range counter ('Showing 1-10 of 120 items').
- Reduced motion fallback with immediate zero-latency transitions.
Keyboard & Accessibility
- Complies with WAI-ARIA Pagination design pattern with semantic <nav role='navigation'>.
- Provides aria-current='page' on the active page button and descriptive aria-labels on controls.
- Full keyboard navigation: ArrowLeft, ArrowRight, Home, and End keys cycle through pages.
- High-contrast focus-visible rings for keyboard users.