ThiloDesign System
DV

Pagination

shadcn/ui

Page navigation controls. Use with DataTable or a ticket list.

@/components/ui/pagination

Live demo — 10 pages

Current page: 5 / 10

Boundary states

StatePreviewNote
First pagePrevious disabled — pointer-events-none opacity-50
Last pageNext disabled — pointer-events-none opacity-50
Few pages (no ellipsis)≤ 7 pages — show all, no ellipsis needed

Tokens

ElementToken
Page numberhover:bg-accent hover:text-accent-foreground — ghost button style
Active pagebg-accent text-accent-foreground — via isActive={true}
Ellipsistext-muted-foreground — non-interactive
Prev / Nextflex items-center gap-1 — label + Chevron icon
Disabledpointer-events-none opacity-50 — apply manually on first/last page

Sub-components

ComponentRole
PaginationRoot nav element — renders as <nav aria-label="pagination navigation">
PaginationContentFlex container for page items — gap-1
PaginationItemWrapper for each page control
PaginationLinkPage number button — isActive prop sets accent background
PaginationPrevious← Previous button — disable manually when on first page
PaginationNextNext → button — disable manually when on last page
PaginationEllipsis… indicator for skipped page ranges — non-interactive

Pagination is link-based. For SPA navigation, pass href="#" and use onClick + e.preventDefault().

On this page