- components
- ›
- pagination
- ›
- svelte
Pagination
Navigate between multiple pages of content.
ID | Name | Country | |
---|---|---|---|
1 | Dr. Darnell Schowalter | Jessie_Mann2@yahoo.com | Niger |
2 | Charlotte Hartmann | Gus.Swaniawski47@hotmail.com | New Zealand |
3 | Enrique Abbott | Alessandra.Walsh3@gmail.com | Saint Helena |
4 | Eunice Reilly | Shanie81@hotmail.com | Zimbabwe |
5 | Douglas Wyman | Petra_Green67@yahoo.com | Grenada |
6 | Derrick Russel | Carter.Rohan11@gmail.com | Ukraine |
7 | Jeff Wunsch | Earline14@yahoo.com | Indonesia |
8 | Brett Spinka | Agnes.Beer@hotmail.com | Luxembourg |
9 | Jack Thompson | Issac_Boyer@hotmail.com | Argentina |
10 | Angelina Purdy | Lamont99@gmail.com | Marshall Islands |
Page Size
ID | Name | Country | |
---|---|---|---|
1 | Blake Sanford | Joany38@gmail.com | Netherlands |
2 | Bob Simonis | Elbert_Kassulke@gmail.com | Anguilla |
3 | Bob Rolfson | Gianni79@hotmail.com | Lesotho |
4 | Domingo Wisozk | Nicole40@yahoo.com | Jordan |
5 | Lonnie Schneider PhD | Israel37@gmail.com | Svalbard & Jan Mayen Islands |
6 | Stacey Rath | Shad24@hotmail.com | Czechia |
7 | Mark Stoltenberg | Catherine46@hotmail.com | Morocco |
8 | Joel Bernhard | Faustino9@gmail.com | Niger |
9 | Brandi Terry | Matilda_Batz@gmail.com | Romania |
10 | Otis Parisian | Anne25@gmail.com | Tonga |
Direction
ID | Name | Country | |
---|---|---|---|
1 | Bobby McGlynn | Kenneth_Pollich44@hotmail.com | Cocos (Keeling) Islands |
2 | Mrs. Julie Zboncak | Leo.Ryan@hotmail.com | Niue |
3 | Stuart Corkery | Jaquelin.Parisian@yahoo.com | Taiwan |
4 | Mr. Randy Goodwin | Laverna_Leffler11@yahoo.com | Bangladesh |
5 | Dr. Greg Green III | Nova1@hotmail.com | Svalbard & Jan Mayen Islands |
6 | Regina Reichel | Lauryn.Spencer95@gmail.com | Samoa |
7 | Stella Ratke | Ervin83@hotmail.com | San Marino |
8 | Lewis Crona | Lazaro.Tillman83@yahoo.com | Isle of Man |
9 | Pearl Howe IV | Jordyn_Roberts-Weimann@yahoo.com | Holy See (Vatican City State) |
10 | Fernando Rowe | Vicenta.Wuckert41@yahoo.com | Micronesia |
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
RootProvider
Property | Default | Type |
---|---|---|
value | - | () => PaginationApi<PropTypes> |
element | - | Snippet<[HTMLAttributes<"div">]> | undefinedRender the element yourself |
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 |
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 |