- components
- ›
- pagination
- ›
- svelte
Pagination
Navigate between multiple pages of content.
ID | Name | Country | |
---|---|---|---|
1 | Mr. Levi Roob I | Yessenia_Wisozk@gmail.com | Turks and Caicos Islands |
2 | Bradford Beer | Nathan95@hotmail.com | Mali |
3 | Dwight Ortiz | Albert11@hotmail.com | Sao Tome and Principe |
4 | Jerome Lockman | Kathryne.Senger90@yahoo.com | Ethiopia |
5 | Dr. Misty Feil | Faustino77@hotmail.com | Bosnia and Herzegovina |
6 | Ted Huel | Lester.Buckridge93@hotmail.com | Portugal |
7 | Helen Anderson | Golda2@gmail.com | Norfolk Island |
8 | Wm Donnelly | Burdette_Kuhic76@gmail.com | Bonaire, Sint Eustatius and Saba |
9 | Dr. Erick Little | Nakia.Kozey58@gmail.com | Benin |
10 | Mario Reynolds | Nicholas_Fritsch4@yahoo.com | Christmas Island |
Page Size
ID | Name | Country | |
---|---|---|---|
1 | Melissa Kulas | Torrey_Ratke@hotmail.com | Somalia |
2 | Leslie Cummings | Audreanne.Becker5@gmail.com | Mexico |
3 | Della Gutkowski IV | Vilma.Goyette@yahoo.com | Guatemala |
4 | Ana Osinski | Antonio16@gmail.com | Botswana |
5 | Clara Daniel DDS | Norbert.Padberg@hotmail.com | Holy See (Vatican City State) |
6 | Ms. Amelia Bartoletti | Conrad78@gmail.com | Cyprus |
7 | Amelia Kshlerin-Kautzer | Hassan67@yahoo.com | Ghana |
8 | Renee Hammes DVM | Barney_Gleason@hotmail.com | United States Minor Outlying Islands |
9 | Jamie Ullrich | Donavon_Wiegand25@yahoo.com | Northern Mariana Islands |
10 | Natasha Wintheiser | Josue30@hotmail.com | Christmas Island |
Direction
ID | Name | Country | |
---|---|---|---|
1 | Greg Johnson | Bella.Pacocha73@gmail.com | United Arab Emirates |
2 | Clayton Leannon | Hector_Von@hotmail.com | Equatorial Guinea |
3 | Roderick Ullrich | Wellington_Dibbert@hotmail.com | Pitcairn Islands |
4 | Angel Berge | Kasandra9@hotmail.com | Norfolk Island |
5 | Caleb Willms | Odessa.McLaughlin@gmail.com | Iraq |
6 | Martin Dibbert MD | Garfield_Aufderhar8@hotmail.com | Saint Helena |
7 | Tom Armstrong | Dimitri78@yahoo.com | Uganda |
8 | Mildred Sawayn | Neva.Huels@hotmail.com | Anguilla |
9 | Gerard Walsh | Tyrique.Wehner@yahoo.com | Mozambique |
10 | Rogelio Dietrich | Shirley.Witting@yahoo.com | Cuba |
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 |