Browse docsPagination

NavigationNew

Glass Pagination

Numbered page buttons with previous and next, folding long runs into an ellipsis.

Preview

Demos ready. Update 0.

Installation

For React 19+ apps with Tailwind CSS 4.

npx shadcn@4.14.1 add @glassyui/glass-pagination

Adds 5 files to components/glassyui and installs clsx.

Usage

Usage

import { GlassPagination } from "@/components/glassyui/glass-pagination";

export function Pages() {
  const [page, setPage] = useState(1);

  return <GlassPagination page={page} pageCount={12} onPageChange={setPage} />;
}

Examples

Show more neighbours

<GlassPagination page={page} pageCount={40} siblingCount={2} onPageChange={setPage} />

API reference

GlassPagination

A nav landmark labelled Pagination, with a button for each shown page.

PropTypeDefaultDescription
pageRequirednumberNoneThe current page, counting from 1. Values outside 1 to pageCount are clamped.
pageCountRequirednumberNoneHow many pages there are.
onPageChangeRequired(page: number) => voidNoneCalled with the page to show. Store it and pass it back as page.
siblingCountnumber1Pages shown on each side of the current page.
boundaryCountnumber1Pages always shown at each end.
previousLabelstring'Previous page'Accessible name of the previous button.
nextLabelstring'Next page'Accessible name of the next button.

Also accepts HTML nav attributes (except onChange).

Types
GlassPaginationProps
Accessibility
Page buttons are named Page N and the current one has aria-current="page".