Pagination

One accent pill slides to the page you pick. Long lists fold into ellipses that follow the current page. Navigation.

Open playground

About

Pagination is a React component in the Navigation category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { Pagination } from "@ashutoshswamy/smoui" and set total, page, defaultPage among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { Pagination } from "@ashutoshswamy/smoui";

<Pagination total={24} page={page} onChange={setPage} />

Props 4

total

Number of pages.

number
page

Controlled, 1-based current page.

number
defaultPage

Initial page when uncontrolled.

numberdefault 1
onChange

Called on change.

(page: number) => void