Pagination

Navigation elements for navigating through a series of related content across multiple pages.

This component requires the FyskProvider. See Quick Start →

Preview

StatefulPagination
TypeScript

Installation

bash
bash
1
npx shadcn@latest add https://fysk.dev/r/pagination.json

Usage

tsx
tsx
1
import {
2
Pagination,
3
PaginationContent,
4
PaginationEllipsis,
5
PaginationItem,
6
PaginationLink,
7
PaginationNext,
8
PaginationPrevious,
9
} from "@/components/ui"
10
11
<Pagination>
12
<PaginationContent>
13
<PaginationItem>
14
<PaginationPrevious href="#" />
15
</PaginationItem>
16
<PaginationItem>
17
<PaginationLink href="#">1</PaginationLink>
18
</PaginationItem>
19
<PaginationItem>
20
<PaginationNext href="#" />
21
</PaginationItem>
22
</PaginationContent>
23
</Pagination>

Examples

Default

Standard manually composed pagination.

Component
TypeScript

Stateful Pagination

Automatically handles ellipses, page math, and first/last buttons.

Component
TypeScript

Features

  • Stateful Helper: StatefulPagination component handles all logic for calculating page ranges and showing ellipses.

  • Glass Variant: Includes a Polished glass variant designed for dark backgrounds and modern UIs.

  • Minimal Style: A borderless minimal variant for a cleaner, less intrusive look.

  • Custom Shapes: Toggle between circle, square, and rounded shapes.

Props

Pagination

PropTypeDefaultDescription
variant"default" | "glass" | "minimal""default"The visual style of the pagination items.
shape"circle" | "square" | "rounded""circle"Internal shape of the page links.
size"sm" | "md" | "lg""md"Visual size of the items.

StatefulPagination

PropTypeDefaultDescription
totalnumber-Total number of items across all pages.
pagenumber-The current active page (1-indexed).
pageSizenumber10Items per page.
siblingCountnumber1Number of page buttons to show on each side of current page.
onChange(page: number) => void-Callback when page changes.
showFirstLastbooleanfalseShows buttons to jump to the very first/last pages.

Accepts all standard HTML attributes.

Built with 💖 | Created by Yashraj