Skip to Content
Archi-ui 1.0.25 is released 🎉
ComponentsPagination

Pagination

The Pagination component enables the user to select a specific page from a range of pages.

Basic Pagination

Usage

import { Pagination } from 'archi-ui'
<Pagination totalPages={10} />

Disabled

Use disabled prop to make the pagination disabled.

Variant

The Pagination comes with two variants: ghost(default), outlined.

Shape

Use shape prop to give different shape to the pagination item.

Size

The Pagination comes with three variants: outlined(default), filled, standard.

Customization

You can optionally enable first-page and last-page buttons using showFirstButton and showLastButton props, and can also customize the control icons using firstButtonIcon and lastButtonIcon props

Custome icons

It’s possible to customize the control icons using previousIcon, nextIcon props

Pagination ranges

You can specify how many digits to display either side of the current page with the siblingCount prop, and adjacent to the start and end page number with the boundaryCount prop.

Controlled

If the page is set using useState, to update to next page or previous page on click, use onPageChange() to update the state of page.

Pagination API

API reference docs for the React Pagination component.

Props

NameTypeDefaultDescription
classNamestring-Override or extend the styles applied to the component
variant'ghost' | 'outlined''ghost'The variant to use.
size'sm' | 'md' | 'lg''md'The size of the component.
color'default' | 'primary' | 'secondary' | 'info' | 'warning' | 'success' | 'error''default'The active color.
shape'pill' | 'rounded' | 'square''rounded'The shape of the pagination items.
disabledboolfalseIf true, the component is disabled.
totalPagesinteger1The total number of pages.
defaultPageinteger1The page selected by default when the component is uncontrolled.
pageinteger-The current page of pagination.
previousIconnode<ArrowSmLeftIcon />Override the default previous icon element.
nextIconnode<ArrowSmRightIcon />Override the default next icon element.
showFirstButtonboolfalseIf true, show the first-page button.
showLastButtonboolfalseIf true, show the last-page button.
firstButtonIconnode<ArrowNarrowLeftIcon />Override the default first-page icon element. Shown only if showFirstButton is set.
lastButtonIconnode<ArrowNarrowRightIcon />Override the default last-page icon element. Shown only if showLastButton is set.
siblingCountinteger1Number of always visible pages before and after the current page.
boundaryCountinteger1Number of always visible pages at the beginning and end.
onPageChangefunc-Callback fired when the page is changed.
Signature: function(page: number) => void.
page: The page selected.
Last updated on