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-paginationAdds 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.
| Prop | Type | Default | Description |
|---|---|---|---|
pageRequired | number | None | The current page, counting from 1. Values outside 1 to pageCount are clamped. |
pageCountRequired | number | None | How many pages there are. |
onPageChangeRequired | (page: number) => void | None | Called with the page to show. Store it and pass it back as page. |
siblingCount | number | 1 | Pages shown on each side of the current page. |
boundaryCount | number | 1 | Pages always shown at each end. |
previousLabel | string | 'Previous page' | Accessible name of the previous button. |
nextLabel | string | '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".