Skip to content

Components

Pagination

Links between pages of results with active and disabled states.

Customize
Ombelle · light

Installation

Run in a project initialized with an Ombelle preset (see Get started). The component uses the saved project preset. Run the command from your app folder; it shows the changes and asks before writing.

pnpm dlx @ombelle-ui/cli@1.1.2 add pagination

Adds components/ui/pagination.tsx and installs react, clsx, tailwind-merge with lifecycle scripts disabled.

In a liquid glass project the plan adds a notice that accessibility is not guaranteed, because text contrast depends on the background behind the glass.

Usage

example.tsx
import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis } from '@/components/ui/pagination'
export function Example(){return <Pagination><PaginationContent><PaginationItem><PaginationPrevious disabled /></PaginationItem><PaginationItem><PaginationLink href="?page=1" isActive aria-label="Page 1">1</PaginationLink></PaginationItem><PaginationItem><PaginationLink href="?page=2" aria-label="Page 2">2</PaginationLink></PaginationItem><PaginationItem><PaginationEllipsis /></PaginationItem><PaginationItem><PaginationNext href="?page=2" /></PaginationItem></PaginationContent></Pagination>}

API and states

API
Pagination, PaginationContent, PaginationItem, PaginationLink (isActive, disabled), PaginationPrevious, PaginationNext, PaginationEllipsis, PaginationCompact (page, pageCount), PaginationPageSize (value, options, onValueChange, range)
Minimum states
Default, active, disabled, focus
Native basis
Native nav, list and anchor links
Styles
Stable in Ombelle, Papier, Organic, Retro futurism, minimalist, neo-brutalism and flat, light and dark. Liquid glass: stable, accessibility not guaranteed.