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.json

Usage

Import the component:

import Pagination from "@/components/pagination"

Use it in your code:

<Pagination />

Props

PropertyTypeDefaultDescription
totalPagesnumber40Total number of pages.
variant"pills" | "outline" | "compact" | "input"all fourRender a single style.
onPageChangefunction-Called when the page changes.