- components
- ›
- pagination
- ›
- svelte
Pagination
Navigate between multiple pages of content.
ID | Name | Country | |
---|---|---|---|
1 | Levi Gislason II | Ivory_Gutmann@yahoo.com | American Samoa |
2 | Todd Stoltenberg | Susana_Halvorson99@hotmail.com | Albania |
3 | Susie O'Conner | Leila_Tremblay@gmail.com | Wallis and Futuna |
4 | Jeff Leuschke | Bettye_Dooley@hotmail.com | Mexico |
5 | Gerardo Dicki | Bert_Jacobi@gmail.com | South Georgia and the South Sandwich Islands |
6 | Traci Nicolas | Major_Donnelly@hotmail.com | Burkina Faso |
7 | Jesus Halvorson | Jayson41@hotmail.com | Russian Federation |
8 | Candace Franecki | Shana.Stracke95@gmail.com | Barbados |
9 | Travis Rutherford | Fern_McCullough@yahoo.com | Afghanistan |
10 | Mr. Joel Howell-Smith | Janet.Haley29@yahoo.com | Dominican Republic |
Page Size
ID | Name | Country | |
---|---|---|---|
1 | Bernice Pagac | Tracy.Monahan35@yahoo.com | Guatemala |
2 | Terence Kris | Macey12@hotmail.com | Aruba |
3 | Alfredo Jacobs | Valerie18@hotmail.com | Wallis and Futuna |
4 | Stuart Ullrich | Ricky.Huels@yahoo.com | Slovakia |
5 | Melody Marks | Daisy.Kuvalis@gmail.com | Lebanon |
6 | Marc Moen | Brady.Schoen@gmail.com | Cape Verde |
7 | Orlando Metz | Jolie.Shanahan@yahoo.com | Yemen |
8 | Clint Vandervort | Kenyatta.Herzog@hotmail.com | Iraq |
9 | Brent Jacobi | Moises_Friesen@yahoo.com | Cocos (Keeling) Islands |
10 | Donald MacGyver | Angelina_Mayer@gmail.com | Colombia |
Direction
ID | Name | Country | |
---|---|---|---|
1 | Bridget Fay | Erik.Roob@hotmail.com | Monaco |
2 | Randolph Batz | Mina55@hotmail.com | Isle of Man |
3 | Leah Morar MD | Amara.Beer73@yahoo.com | China |
4 | Chester Weber PhD | Dan.Pacocha22@gmail.com | Liechtenstein |
5 | Willie Rau | Kitty_Hermiston@hotmail.com | Malta |
6 | Geneva Reilly | Aliya32@hotmail.com | Bonaire, Sint Eustatius and Saba |
7 | Roger Cruickshank | Ruben_DAmore21@hotmail.com | South Georgia and the South Sandwich Islands |
8 | Tyler Collier | Charlene_Little33@gmail.com | Gabon |
9 | Cody Miller | Ora81@hotmail.com | Cuba |
10 | Melanie Reilly Jr. | Louisa_Parker91@yahoo.com | Democratic Republic of the Congo |
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 |