- components
- ›
- pagination
- ›
- react
Pagination
Navigate between multiple pages of content.
ID | Name | Country | |
---|---|---|---|
1 | Jerry Bins | Brain_Fahey@hotmail.com | Papua New Guinea |
2 | Dr. Geoffrey Hoppe | Brandy58@yahoo.com | United States of America |
3 | Karl Sawayn | Kali.Weimann@gmail.com | Saint Helena |
4 | Edmund Anderson IV | Bennett18@yahoo.com | Liberia |
5 | Lynn Kreiger | Alexa_Jaskolski@gmail.com | Hong Kong |
6 | Tiffany Bartell | Enoch24@hotmail.com | Niger |
7 | Bethany Macejkovic | German62@gmail.com | Nepal |
8 | Dr. Don Russel | Brant_Vandervort@hotmail.com | Kuwait |
9 | Jan Ward | Barbara96@gmail.com | Iceland |
10 | Phyllis Wolf | Eusebio.Little@gmail.com | Ecuador |
Page Size
ID | Name | Country | |
---|---|---|---|
1 | Jill Koss | Nico_Lemke@gmail.com | Lao People's Democratic Republic |
2 | Bryan Treutel | Tatum_Mayert54@hotmail.com | New Zealand |
3 | Rudy Schuppe | Cynthia_Sauer@gmail.com | South Sudan |
4 | Barbara Swift MD | Afton92@yahoo.com | Taiwan |
5 | Alejandro Wolf | Pearl_OKeefe@yahoo.com | Tanzania |
6 | Mary Bergstrom | Kenya_OConnell@gmail.com | Taiwan |
7 | Patrick Kessler | Juliana74@yahoo.com | Netherlands |
8 | Edith McClure | Ola1@yahoo.com | Malawi |
9 | Mr. Caleb Steuber | Royal.Steuber-Douglas@hotmail.com | Liberia |
10 | Joanna Bailey | Leonard35@yahoo.com | Croatia |
Direction
ID | Name | Country | |
---|---|---|---|
1 | Josefina Hane | Cicero28@yahoo.com | Bonaire, Sint Eustatius and Saba |
2 | Timmy Von | Liliana.Schultz98@hotmail.com | Suriname |
3 | Howard Trantow | Davion27@yahoo.com | Singapore |
4 | Max Grady | Chet.Barton@gmail.com | Turkmenistan |
5 | Brittany Von | Griffin.Leannon-Russel61@gmail.com | Aruba |
6 | Katie Witting | Buster35@yahoo.com | Liechtenstein |
7 | Randy Jast | Royce62@yahoo.com | Democratic People's Republic of Korea |
8 | Shelia Stanton | Price19@yahoo.com | Croatia |
9 | Ruth Pfannerstill | Clovis53@yahoo.com | Belgium |
10 | Scott Toy | Marcia39@gmail.com | Czechia |
Total Count
For server-side pagination, your data source may be truncated. Make sure to specify the total records using count
.
{ "data": [...], "pagination": { "page": 1, "limit": 10, "count": 500, }}
<Pagination page={response.pagination.page} count={response.pagination.count} pageSize={response.pagination.limit}> ...</Pagination>
API Reference
Root
inline-flex gap-2 p-2 rounded-container preset-outlined-surface-200-800 w-fit
Property | Default | Type |
---|---|---|
ids | - | Partial<{ root: string; ellipsis: (index: number) => string; prevTrigger: string; nextTrigger: string; item: (page: number) => string; }> | undefinedThe ids of the elements in the accordion. Useful for composition. |
translations | - | IntlTranslations | undefinedSpecifies the localized strings that identifies the accessibility elements and their states |
count | - | number | undefinedTotal number of data items |
pageSize | - | number | undefinedThe controlled number of data items per page |
defaultPageSize | 10 | number | undefinedThe initial number of data items per page when rendered. Use when you don't need to control the page size of the pagination. |
siblingCount | 1 | number | undefinedNumber of pages to show beside active page |
page | - | number | undefinedThe controlled active page |
defaultPage | 1 | number | undefinedThe initial active page when rendered. Use when you don't need to control the active page of the pagination. |
onPageChange | - | ((details: PageChangeDetails) => void) | undefinedCalled when the page number is changed |
onPageSizeChange | - | ((details: PageSizeChangeDetails) => void) | undefinedCalled when the page size is changed |
type | "button" | "button" | "link" | undefinedThe type of the trigger element |
getPageUrl | - | ((details: PageUrlDetails) => string) | undefinedFunction to generate href attributes for pagination links. Only used when `type` is set to "link". |
dir | "ltr" | "ltr" | "rtl" | undefinedThe document's text/writing direction. |
getRootNode | - | (() => ShadowRoot | Node | Document) | undefinedA root node to correctly resolve document in custom environments. E.x.: Iframes, Electron. |
element | - | ((attributes: HTMLAttributes<"nav">) => Element) | undefinedRender the element yourself |
RootProvider
Property | Default | Type |
---|---|---|
value | - | PaginationApi<PropTypes> |
element | - | ((attributes: HTMLAttributes<"nav">) => Element) | undefinedRender the element yourself |
RootContext
Property | Default | Type |
---|---|---|
children | - | (pagination: PaginationApi<PropTypes>) => ReactNode |
PrevTrigger
btn preset-tonal
Property | Default | Type |
---|---|---|
element | - | ((attributes: HTMLAttributes<"button">) => Element) | undefinedRender the element yourself |
Item
btn preset-tonal cursor-pointer select-none data-selected:preset-filled
Property | Default | Type |
---|---|---|
type | - | "page" |
value | - | number |
element | - | ((attributes: HTMLAttributes<"a">) => Element) | undefinedRender the element yourself |
Ellipsis
btn preset-tonal pointer-events-none
Property | Default | Type |
---|---|---|
index | - | number |
element | - | ((attributes: HTMLAttributes<"span">) => Element) | undefinedRender the element yourself |
NextTrigger
btn preset-tonal
Property | Default | Type |
---|---|---|
element | - | ((attributes: HTMLAttributes<"button">) => Element) | undefinedRender the element yourself |