Pagination

Sketch-circled page buttons with a heavier active ring. Prev/next use hand-drawn arrows.

<Pagination page={2} count={8} onPageChange={setPage} roughness={1.5} />

CLI install

npx doodleui-react add pagination

Usage

import { Pagination } from "doodleui-react";

<Pagination page={2} count={8} onPageChange={setPage} />

The current page sets aria-current="page". The nav is labeled "Pagination".

Props

PropTypeDefaultNotes
pagenumberrequired1-based current page. Gets aria-current.
countnumberrequiredTotal page count.
onPageChange(page: number) => voidundefinedFires for numbered buttons and prev/next.
roughnessnumber1.5How wobbly the stroke is. 0 is almost geometric. 3+ is messy.
seednumberprovider / randomLocks the sketch. Omit to follow SketchSeedProvider (Shuffle) or a mount-time random seed.
sketchColorstring#1f1d1aStroke color. Also tints primary/accent fills where relevant.
classNamestringundefinedPassed through to the root element.
styleCSSPropertiesundefinedPassed through to the root element.