Display
Pagination
Navigation between pages of a data set, with a bindable current page.
<script>
import { Pagination } from "@codeatlasdev/ui";
</script>
<Pagination count={100} perPage={10} bind:page />
count is the total number of items, not the number of pages. Pages are numbered from 1.
Basic
Current page: 1
Code
More siblings
`siblingCount` controls how many pages show around the current one.
Code
Few items
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
count | number | – | Total number of items to paginate. Required. |
perPage | number | 10 | Items per page. |
page | number | 1 | Current page, 1-based. Bindable. |
siblingCount | number | 1 | Pages shown on each side of the current page. |
onPageChange | (page: number) => void | undefined | Called when the page changes. |
class | string | '' | Extra class names. |