Skip to content
satin

Pagination

Moves through a long list one page at a time.

Installation

Terminal
npm i @uisatin/ui
Import
import { Pagination } from '@uisatin/ui/pagination'

About 18.2 kB of JavaScript, minified and gzipped, with what it imports (React aside). The stylesheet is one file for every component.

First time with Satin? Set it up once, styles and fonts included, with the installation guide.

API Reference

The Pagination component renders a nav named "Pagination" around a list of pages. The current page has aria-current="page"; Previous and Next are disabled at the ends. With getHref the pages are links, otherwise buttons.

PropTypeDefault
pageCount
number
—
page
number
—
defaultPage
number
1
onPageChange
(page: number) => void
—
getHref
(page: number) => string
—
layout
"full""compact"
"full"
siblings
number
1
motion
"scroll""slide""none"
"scroll"
previousLabel
string
"Previous"
nextLabel
string
"Next"
className
string
—
ref
Ref<HTMLElement>
—
...props
ComponentProps<'nav'>

Other attributes go to <nav>

—

Accessibility

A nav named "Pagination" (aria-label overrides it) around a list. Pages are named "Page 3"; the current one has aria-current="page". Previous and Next are disabled at the ends and named when icon-only. The compact "Page 5 of 12" is a polite live region. The ellipsis is hidden. With getHref the pages are links, otherwise buttons.