Skip to main content

Pagination

Page navigation with a spring active indicator, a hover pill that glides across gaps, and accessible current-page markup.

page=2/ 6·items 11-20

Customize

Spring speed1

Installation

npx shadcn@latest add @kinetic/pagination

Usage

Mark the current page with isActive on its PaginationLink.

import {
  Pagination,
  PaginationContent,
  PaginationEllipsis,
  PaginationItem,
  PaginationLink,
  PaginationNext,
  PaginationPrevious,
} from "@/components/kinetic/ui/pagination";

export function Pages() {
  return (
    <Pagination>
      <PaginationContent>
        <PaginationItem>
          <PaginationPrevious href="?page=1" />
        </PaginationItem>
        <PaginationItem>
          <PaginationLink href="?page=1">1</PaginationLink>
        </PaginationItem>
        <PaginationItem>
          <PaginationLink href="?page=2" isActive>
            2
          </PaginationLink>
        </PaginationItem>
        <PaginationItem>
          <PaginationEllipsis />
        </PaginationItem>
        <PaginationItem>
          <PaginationNext href="?page=3" />
        </PaginationItem>
      </PaginationContent>
    </Pagination>
  );
}

Variants

Choose the indicator style with variant: pill, underline or solid.

<Pagination variant="underline">...</Pagination>

Hover pill

showHoverPill (on by default) renders one highlight that slides between page buttons. Set it to false for plain hover styles.

<Pagination showHoverPill={false}>...</Pagination>

Client-side state

Prevent the default navigation in onClick when the page lives in React state.

<PaginationLink
  href="#page-3"
  isActive={page === 3}
  onClick={(event) => {
    event.preventDefault();
    setPage(3);
  }}
>
  3
</PaginationLink>

Motion preferences

Use speed to scale the indicator spring and the hover glide. Reduced motion moves the indicator without animation.

API Reference

Pagination

Zero-dependency pagination landmark configuring indicator variant, spring speed, and continuous sliding hover pill.

PropTypeDefaultDescription
variant"pill" | "underline" | "solid""pill"Visual style of the spring-gliding active page indicator.
speednumber1Speed multiplier (0.25-4) for active indicator spring and hover glide.
showHoverPillbooleantrueRenders a continuous sliding hover pill that glides smoothly across gaps between page buttons.

PaginationContent / PaginationItem / PaginationLink / PaginationPrevious / PaginationNext / PaginationEllipsis

Semantic list container with shared indicator tracking, page links supporting isActive and size, prev/next controls, and ellipsis.

PropTypeDefaultDescription
isActive / size (PaginationLink)boolean / "sm" | "default" | "lg" | "icon"false / "icon"Marks the current page with aria-current='page' and targets the spring indicator.

Notes

PaginationLink renders an anchor tag directly; for client-side state updates without URL navigation, handle onClick with event.preventDefault().