Pagination

A beautiful pagination component with multiple variants, colors, and smooth animations.

The Pagination component provides an elegant, accessible pagination controls with smooth motion animations, multiple visual styles, and extensive color variants.

Preview

Usage

Installation

$ pnpm dlx shadcn add https://klarden.vercel.app/r/pagination.json

Examples

Basic Usage

Simple pagination with default styling.

Style Variants

Explore different visual styles available in the component.

Solid
Outline
Ghost
Squircle

Properties

PropTypeDefaultDescription
totalPagesnumber—Total number of pages. Required.
currentPagenumber—Current active page (1-indexed). Required.
onPageChange(page: number) => void—Callback when page changes. Required.
siblingCountnumber1Number of sibling pages to show around current page.
colorPaginationColor"default"Color variant for the active page. Options: default, blue, purple, pink, red, orange, green, teal, cyan, indigo, violet, rose, amber, lime, sky, emerald, fuchsia.
variantPaginationVariant"solid"Visual style variant. Options: solid, outline, ghost, squircle.
showEdgesbooleanfalseShow first/last page buttons with double chevrons.
size"sm" | "md" | "lg""md"Size of pagination buttons.
classNamestring—Additional CSS classes for the pagination container.

Hook

usePaginationState

A convenience hook for pagination state management.

const { page, setPage, nextPage, prevPage, resetPage } = usePaginationState(1);