Skip to Content
Nextra 4.0 is released 🎉

Pagination

The Pagination component is a pixel-art styled page navigation control.
It supports configurable page ranges, default page selection, and custom styling — ideal for paginated content with a retro aesthetic.


🚀 Usage

Basic Example


import { Pagination } from "pixelartui-react"; <Pagination totalPages={10} onChange={(page) => console.log(page)} />

Few Pages


<Pagination totalPages={3} onChange={(page) => console.log(page)} />

Default Page


<Pagination totalPages={10} defaultPage={5} onChange={(page) => console.log(page)} />

Many Pages


<Pagination totalPages={50} defaultPage={25} onChange={(page) => console.log(page)} />

Custom Background


<Pagination totalPages={10} backgroundColor="#05EB57" onChange={(page) => console.log(page)} />

Styles


<Pagination totalPages={10} paginationStyle="dark" onChange={(page) => console.log(page)} /> <Pagination totalPages={10} paginationStyle="light" onChange={(page) => console.log(page)} />

đź”§ Props

PropTypeDefaultDescription
totalPagesnumber—Total number of pages available.
currentPagenumberundefinedControlled current page (makes component controlled).
defaultPagenumber1Initial page when used as an uncontrolled component.
siblingCountnumber1Number of page buttons shown around the current page.
paginationStyle"dark" | "light""dark"Applies a light or dark theme to the component.
backgroundColorstringundefinedCustom background color for the active page button.
classNamestringundefinedAdds additional CSS classes for custom styling.
onChange(page: number) => voidundefinedCallback fired when the current page changes.
Last updated on