Animated Pagination

Preview

Page 6 of 20

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/pagination

API Reference

totalPages
number
Default—
page?
number
Default—
defaultPage?
number
Default1
onPageChange?
((page: number) => void)
Default—
siblings?
number

Pages shown either side of the current one.

Default1
boundaries?
number

Pages always shown at each end.

Default1
jump?
number

Pages an ellipsis jumps when pressed.

Default5
getHref?
((page: number) => string)

Render pages as links. Each control still calls `onPageChange`, so a client router can update state while the href keeps the page shareable.

Default—
renderLink?
((props: DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => ReactElement<...>)

Render your router's Link, spreading these props onto it.

Default—
className?
string
Default—

Updated