Back to Components
Pagination
A self-contained pagination component with four visual variants, each independently functional. Every variant smoothly animates its active-page highlight with Framer Motion. Render all four stacked, or a single variant via the variant prop.
Preview
Installation
Install the component using the CLI.
npx shadcn@latest add https://shreyashtech.me/r/pagination.jsonUsage
Import the component:
import Pagination from "@/components/pagination"Use it in your code:
<Pagination />Props
| Property | Type | Default | Description |
|---|---|---|---|
| totalPages | number | 40 | Total number of pages. |
| variant | "pills" | "outline" | "compact" | "input" | all four | Render a single style. |
| onPageChange | function | - | Called when the page changes. |