- components
- ›
- pagination
- ›
- svelte
Pagination
Navigate between multiple pages of content.
ID | Name | Country | |
---|---|---|---|
1 | Oliver Prosacco | Samson62@gmail.com | Samoa |
2 | Annette Becker V | Arlo.OConnell94@gmail.com | Bahamas |
3 | Aaron Stamm | Colton.Gorczany@gmail.com | Jordan |
4 | Eric Hills | Ophelia_McCullough@gmail.com | Sao Tome and Principe |
5 | Mr. Irvin Prohaska | Cathrine15@hotmail.com | Liberia |
6 | Heather Stracke | Lisandro_Strosin@hotmail.com | Bouvet Island |
7 | Miss Gertrude Powlowski DVM | Leon_Purdy32@gmail.com | Israel |
8 | Roderick Gottlieb DDS | Nella_Rippin15@hotmail.com | Bonaire, Sint Eustatius and Saba |
9 | Katrina Schuppe | Keira.Hand77@yahoo.com | Turkmenistan |
10 | Ms. Brandi Brown | Isai29@yahoo.com | Yemen |
Page Size
ID | Name | Country | |
---|---|---|---|
1 | Howard Lang | Joe78@yahoo.com | Botswana |
2 | Jeremiah Schulist | Izaiah54@hotmail.com | Guinea-Bissau |
3 | Mr. William Farrell | Madalyn_Cummerata17@gmail.com | Niue |
4 | Pete Mosciski Sr. | Roosevelt15@gmail.com | Qatar |
5 | Robin Torp | Maia_Pfeffer-Powlowski80@gmail.com | Lebanon |
6 | Rosie Jaskolski | Emmanuelle88@yahoo.com | Namibia |
7 | Homer Kerluke | Charlie.Terry95@yahoo.com | Zambia |
8 | Dwight Renner | Gertrude.Stoltenberg@yahoo.com | France |
9 | Amanda Herman | Nora.Connelly@hotmail.com | Gabon |
10 | Helen Gerhold | Ethel63@gmail.com | Brunei Darussalam |
Direction
ID | Name | Country | |
---|---|---|---|
1 | Misty Legros | Imogene63@gmail.com | Mozambique |
2 | Dr. Angelica Reichel | Green_Schuster12@yahoo.com | New Caledonia |
3 | Ms. Allison Quitzon | Mitchel_Kihn42@hotmail.com | Solomon Islands |
4 | Heather Prosacco | Saige.Oberbrunner37@hotmail.com | Bulgaria |
5 | Eleanor Gislason | Ewald.Hills66@yahoo.com | Gabon |
6 | Tami Schuppe DVM | Crystel_Larkin61@gmail.com | Finland |
7 | Dr. Clinton Satterfield | Elliot.Kuhic60@gmail.com | Jamaica |
8 | Kyle Balistreri | Clarissa_Schimmel18@yahoo.com | Brazil |
9 | Viola Walter | Brady78@yahoo.com | Montenegro |
10 | Frank Reichel | Pierce13@yahoo.com | Bulgaria |
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 |