- components
- ›
- pagination
- ›
- svelte
Pagination
Navigate between multiple pages of content.
ID | Name | Country | |
---|---|---|---|
1 | Ron Hackett MD | Crystal.Koch@gmail.com | Portugal |
2 | Naomi Stehr | Kyra80@gmail.com | Sierra Leone |
3 | Alonzo Kohler | Mayra16@gmail.com | Guinea-Bissau |
4 | Charlene Ondricka | Duncan_Krajcik-Rath66@gmail.com | Myanmar |
5 | Sandy Bartoletti | Bailey46@yahoo.com | Western Sahara |
6 | Mr. Caleb Orn | Josefa56@hotmail.com | Guinea |
7 | Terrance Vandervort | Logan.Lemke4@yahoo.com | Bosnia and Herzegovina |
8 | Ms. Frances Carter | Dorothy53@gmail.com | Guatemala |
9 | Francisco Renner-Wunsch I | Elnora_West@hotmail.com | Tanzania |
10 | Oscar O'Connell | Tabitha_Keebler44@yahoo.com | United States of America |
Page Size
ID | Name | Country | |
---|---|---|---|
1 | Russell Smitham | Geo.Gislason11@hotmail.com | Virgin Islands, British |
2 | Lola Robel | Theron82@gmail.com | Zimbabwe |
3 | Rebecca McDermott | Jasen45@gmail.com | Azerbaijan |
4 | Don Torp | Trudie97@yahoo.com | Indonesia |
5 | Marc Hackett | Carter56@hotmail.com | Liechtenstein |
6 | Irvin Gleichner | Jessy.Hudson@gmail.com | Greenland |
7 | Dr. Veronica Konopelski | Litzy42@gmail.com | Kiribati |
8 | Conrad VonRueden | Lisa.Mante75@gmail.com | Vanuatu |
9 | Harvey Predovic | Keanu.Feil@yahoo.com | United Arab Emirates |
10 | Mable Marquardt-Strosin | Mylene7@gmail.com | Uruguay |
Direction
ID | Name | Country | |
---|---|---|---|
1 | Shawn White | Kristy_Torp@hotmail.com | Mayotte |
2 | Jeremiah Little | Haven.VonRueden36@gmail.com | Greenland |
3 | Jerome Graham | Deangelo13@gmail.com | Oman |
4 | Mrs. Jacquelyn Christiansen III | Edythe.Kling41@gmail.com | Montenegro |
5 | Melvin Glover-Hessel | Vernice_Osinski@hotmail.com | Honduras |
6 | Henry Steuber | Ezekiel.Kerluke@hotmail.com | Palau |
7 | Carroll Rolfson-Hamill | Roman_Jerde3@gmail.com | Switzerland |
8 | Denise Marvin | Elinor.Cronin34@yahoo.com | Ghana |
9 | John Legros | Marilou_Graham17@yahoo.com | Liberia |
10 | Jana Zemlak | Sandrine.Hamill@gmail.com | Papua New Guinea |
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 |