- components
- ›
- pagination
- ›
- svelte
Pagination
Navigate between multiple pages of content.
ID | Name | Country | |
---|---|---|---|
1 | Leslie Runolfsdottir | Moriah62@gmail.com | Malaysia |
2 | Bradley Jacobi | Deanna69@yahoo.com | Yemen |
3 | Salvador Gibson | Thora39@yahoo.com | Malaysia |
4 | Dr. Wade Wintheiser | Mellie_OKeefe36@hotmail.com | Samoa |
5 | Mr. Guy Strosin | Sydnie82@gmail.com | Hungary |
6 | Mercedes Nolan | Craig80@yahoo.com | United Kingdom |
7 | Dr. Raymond Konopelski | Catherine_Kuphal@hotmail.com | Romania |
8 | Gerard Wilderman | Mia16@hotmail.com | Mozambique |
9 | Nicolas Lowe | Savanah.Nitzsche@yahoo.com | Kuwait |
10 | Carl Zulauf | Garnett.Lindgren20@yahoo.com | Albania |
Page Size
ID | Name | Country | |
---|---|---|---|
1 | Gail Nikolaus | Ethyl.Beahan50@yahoo.com | Costa Rica |
2 | Gerald Cormier | Andre_Nicolas@gmail.com | Nepal |
3 | Alonzo Rohan | Monica.Rosenbaum5@hotmail.com | Dominica |
4 | Laverne Skiles | Ottis_Robel@yahoo.com | China |
5 | Sonja Bogan PhD | Cornelius46@gmail.com | Ghana |
6 | Pablo Wunsch | Adolfo_Schinner@yahoo.com | Angola |
7 | Matthew Hegmann | Destini_Hettinger72@hotmail.com | Montserrat |
8 | Mrs. Leona Price | Edgardo_Swaniawski53@gmail.com | Benin |
9 | Noah Cummerata | Zula67@gmail.com | French Polynesia |
10 | Candice Reilly-Weissnat | Kiera34@hotmail.com | Curacao |
Direction
ID | Name | Country | |
---|---|---|---|
1 | Leticia Wyman | Zoe45@yahoo.com | Sierra Leone |
2 | Viola Lemke | Marianne_McDermott@yahoo.com | Saint Kitts and Nevis |
3 | Nelson Hayes | Sarah30@gmail.com | Montenegro |
4 | Pat Lehner | Dixie76@hotmail.com | Bolivia |
5 | Percy Gorczany | Vicenta81@gmail.com | Ghana |
6 | Emanuel King | Bonnie_Bode54@gmail.com | Timor-Leste |
7 | Steven Williamson | Lindsey96@hotmail.com | Hungary |
8 | Al Lakin | Lurline_Cummings@yahoo.com | Central African Republic |
9 | Donald Bruen | Alverta38@yahoo.com | Gambia |
10 | Warren Skiles | Casey2@hotmail.com | Colombia |
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 | - | 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
btn preset-tonal
Property | Default | Type |
---|---|---|
element | - | Snippet<[HTMLAttributes<"button">]> | undefinedRender the element yourself |
Item
btn preset-tonal cursor-pointer select-none data-selected:preset-filled
Property | Default | Type |
---|---|---|
type | - | "page" |
value | - | number |
element | - | Snippet<[HTMLAttributes<"a">]> | undefinedRender the element yourself |
Ellipsis
btn preset-tonal pointer-events-none
Property | Default | Type |
---|---|---|
index | - | number |
element | - | Snippet<[HTMLAttributes<"span">]> | undefinedRender the element yourself |
NextTrigger
btn preset-tonal
Property | Default | Type |
---|---|---|
element | - | Snippet<[HTMLAttributes<"button">]> | undefinedRender the element yourself |