Pagination

A long list can be divided into several pages using Pagination, and only one page will be loaded at a time.

Pagination is useful when:

  • The list is too long to fit in the screen,
  • It will take a long time to load/render all the items,
  • If you want to browse the data by navigating through pages.

Usage

The Pagination component can be imported using

import { Pagination } from '@tail-kit/tail-kit'

Default Pagination

With Size Changer

...

With Page Jumper

...
Go to

Controlled Pagination

Selected Page: 3
...

Pagination Props

NameDescriptionDefault Value
current
Use current prop along with onChange to create controlled Pagination component
number | undefined
--
defaultCurrent
Default initial page number
number | undefined
1
total
Total number of data items
number
--
pageRangeDisplayed
Number of total PageButtons displayed together
number | undefined
5
boundaryPageButtons
Fixed number of buttons on both side of Pagination component
number | undefined
2
showSizeChanger
Determine whether to show pageSize select
boolean | undefined
--
showQuickJumper
Determine whether you can jump to pages directly
boolean | undefined
--
pageSizeOptions
Specify the sizeChanger options
string[] | undefined
['10', '20', '50', '100']
onChange
Called when the page number is changed, and it takes the resulting page number and pageSize as its arguments
OnChangeType | undefined
--
className
Additional classes applied to the Pagination component
string | undefined
--
style
Additional styles applied to the Pagination component
CSSProperties | undefined
--