Park UI

Pagination

A navigation component for browsing through multiple pages of content.

Installation

Usage

Shortcuts

The Pagination component also provides a set of shortcuts for common use cases.

PaginationItems

This component renders the number of pages based on the count and pageSize props. Rendering this:

is shorthand for this:

Props

Root

PropDefaultType
defaultPage1
number

The initial active page when rendered. Use when you don't need to control the active page of the pagination.

defaultPageSize10
number

The initial number of data items per page when rendered. Use when you don't need to control the page size of the pagination.

siblingCount1
number

Number of pages to show beside active page

type\button\
'button' | 'link'

The type of the trigger element

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

count
number

Total number of data items

ids
Partial<{ root: string ellipsis: (index: number) => string prevTrigger: string nextTrigger: string item: (page: number) => string }>

The ids of the elements in the accordion. Useful for composition.

onPageChange
(details: PageChangeDetails) => void

Called when the page number is changed

onPageSizeChange
(details: PageSizeChangeDetails) => void

Called when the page size is changed

page
number

The controlled active page

pageSize
number

The controlled number of data items per page

translations
IntlTranslations

Specifies the localized strings that identifies the accessibility elements and their states

Ellipsis

PropDefaultType
index*
number
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

Item

PropDefaultType
type*
'page'
value*
number
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.