Skip to content
Ballpoint

Pagination

Page links for a long list. The current page is boxed in pen; the others are written plain.

From shadcn/ui
Built on Base UI Button

Installation

pnpm dlx shadcn@latest add @ballpoint/pagination

Usage

tsx
import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from "@/components/ui/pagination"

<Pagination>
  <PaginationContent>
    <PaginationItem><PaginationPrevious href="#" /></PaginationItem>
    <PaginationItem><PaginationLink href="#" isActive>1</PaginationLink></PaginationItem>
    <PaginationItem><PaginationNext href="#" /></PaginationItem>
  </PaginationContent>
</Pagination>

Examples

Controlled

Page state kept in React, with the run of links trimmed around the current page.

Page 5 of 12

Compact

Just previous, next and where you are.

API reference

PaginationLink isActive
default false
boolean

Boxes the link and marks it aria-current="page".

PaginationLink size
default "icon"
"icon" | "default" | …

Any Button size.

render
default <a />
ReactElement

Render the link as your framework's.

seed
string | number

Pins the drawing.

Every other prop goes to Base UI's Button.