Pagination - Skeleton

  1. components
  2. pagination
  3. svelte

Pagination

Navigate between multiple pages of content.

PositionNameWeightSymbol
1Hydrogen1.0079H
2Helium4.0026He
3Lithium6.941Li
4Beryllium9.0122Be
5Boron10.811B

Alternative UI

Display an alternative interface using the alternative property.

1 - 3 1 of 2

Handling Total Count

If your source data is pre-truncated (ex: server-side pagination). Make sure to specify the total item count.

// Mock Server Response
pagination: {
"page": 1,
"limit": 2,
"pages": 1,
"total": 1, // <----
"next": null,
"prev": null
}
<Pagination count={pagination.total} ... />

API Reference

Pagination

Property Type Description
data *
Provide source data as an array.
count
number
Total number of data items. Required for server-side pagination.
page *
number
Bind the current page.
pageSize *
number
Bind the number of data items to display.
alternative
boolean
Enables alternative display with stats and first/last buttons.
textSeparator
string
Set the separator text or character, such as "of" in "X of Y".
showFirstLastButtons
boolean
Show first and last page button.
base
string
Sets base classes for the list.
background
string
Sets background classes for the list.
border
string
Sets border classes for the list.
gap
string
Sets gap classes for the list.
padding
string
Sets padding classes for the list.
rounded
string
Sets border radius classes for the list.
classes
string
Provide arbitrary CSS classes for the root.
titleFirst
string
Set an optional title for the first button.
titlePrevious
string
Set an optional title for the previous button.
titleNumeral
string
Set an optional title for the numeral buttons (ex: Page 1).
titleNext
string
Set an optional title for the next button.
titleLast
string
Set an optional title for the last button.
buttonBase
string
Sets base classes for buttons.
buttonActive
string
Sets active state classes for buttons.
buttonInactive
string
Sets inactive state classes for buttons.
buttonHover
string
Sets hover state classes for buttons.
buttonClasses
string
Provide arbitrary CSS classes for buttons.
labelFirst
Snippet<[]>
Set button icon or label for first button.
labelPrevious
Snippet<[]>
Set button icon or label for previous button.
labelEllipsis
Snippet<[]>
Set button icon or label for ellipsis.
labelNext
Snippet<[]>
Set button icon or label for next button.
labelLast
Snippet<[]>
Set button icon or label for last button.
ids
The ids of the elements in the accordion. Useful for composition.
translations
Specifies the localized strings that identifies the accessibility elements and their states
siblingCount
number
Number of pages to show beside active page
Default: 1
onPageChange
Called when the page number is changed
onPageSizeChange
Called when the page size is changed
type
"button" | "link"
The type of the trigger element
Default: "button"
dir
"ltr" | "rtl"
The document's text/writing direction.
Default: "ltr"
getRootNode
A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.