- components
- ›
- pagination
- ›
- svelte
Pagination
Navigate between multiple pages of content.
ID | Name | Country | |
---|---|---|---|
1 | Rex Bayer PhD | Leola_Ritchie@gmail.com | Saudi Arabia |
2 | Guillermo Kunde | Caesar.Ziemann@gmail.com | Yemen |
3 | Darrell Heller | Yazmin29@yahoo.com | Slovakia |
4 | Micheal Morissette DDS | Bernard.Kovacek33@gmail.com | Indonesia |
5 | Wilson Goldner | Elenor_Hane@gmail.com | Serbia |
6 | Ronald O'Conner | Dolores.Kozey77@hotmail.com | Kuwait |
7 | Johanna Jakubowski | Cale_Beatty9@hotmail.com | China |
8 | Tanya Effertz | Cooper.Ziemann@hotmail.com | Anguilla |
9 | Gail Parisian | Kathryne_Marquardt14@hotmail.com | Egypt |
10 | Miss Pam Torp | Berry.Schneider44@hotmail.com | Gibraltar |
Page Size
ID | Name | Country | |
---|---|---|---|
1 | Rachael Cartwright | Bulah.McGlynn@hotmail.com | Cape Verde |
2 | Maurice Leuschke | Troy41@yahoo.com | Iran |
3 | Linda Cartwright Sr. | Rosendo.Ruecker@hotmail.com | Sri Lanka |
4 | Mr. Stanley Blick | Flavie.Brekke@gmail.com | Venezuela |
5 | Doyle Gibson | Noe_Schinner@gmail.com | Bosnia and Herzegovina |
6 | Tracy Hilpert I | Talia56@gmail.com | Honduras |
7 | Bertha Corwin-Reichert | Sarah_VonRueden63@gmail.com | Singapore |
8 | Justin Kihn Jr. | Kellie71@gmail.com | Cocos (Keeling) Islands |
9 | Rosemarie Hartmann | Louvenia_Carter@hotmail.com | Saint Helena |
10 | Willie Koepp | Fern57@gmail.com | Guatemala |
Direction
ID | Name | Country | |
---|---|---|---|
1 | Sandra Schaefer | Theresa56@yahoo.com | Ethiopia |
2 | Shelley Nader | Cristal.Williamson@hotmail.com | Central African Republic |
3 | Dr. Mattie Schimmel | Rosalind.Farrell87@gmail.com | United Arab Emirates |
4 | Leona Walter | Braulio93@yahoo.com | Mongolia |
5 | Andrea Stark | Jeffry.Altenwerth30@hotmail.com | Montenegro |
6 | Loren Aufderhar | Kaleb_Beer23@hotmail.com | Somalia |
7 | Pamela Lakin | Arielle.Walsh@gmail.com | Australia |
8 | Orville Stroman | Johnpaul89@hotmail.com | Lao People's Democratic Republic |
9 | Trevor Yundt V | Rick_Hoppe@hotmail.com | Cocos (Keeling) Islands |
10 | Genevieve Thiel Sr. | Joanne_Johnston77@gmail.com | Bermuda |
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
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 | - | Snippet<[HTMLAttributes<"div">]> | undefinedRender the element yourself |
RootProvider
Property | Default | Type |
---|---|---|
value | - | () => PaginationApi<PropTypes> |
element | - | Snippet<[HTMLAttributes<"div">]> | undefinedRender the element yourself |
RootContext
Property | Default | Type |
---|---|---|
children | - | Snippet<[() => PaginationApi<PropTypes>]> |
PrevTrigger
Property | Default | Type |
---|---|---|
element | - | Snippet<[HTMLAttributes<"button">]> | undefinedRender the element yourself |
Item
Property | Default | Type |
---|---|---|
type | - | "page" |
value | - | number |
element | - | Snippet<[HTMLAttributes<"a">]> | undefinedRender the element yourself |
Ellipsis
Property | Default | Type |
---|---|---|
index | - | number |
element | - | Snippet<[HTMLAttributes<"span">]> | undefinedRender the element yourself |
NextTrigger
Property | Default | Type |
---|---|---|
element | - | Snippet<[HTMLAttributes<"button">]> | undefinedRender the element yourself |