Pagination
<sl-pagination> | SlPagination
Pagination component.
<!-- will not render without total prop --> <sl-pagination></sl-pagination> <br><br> <sl-pagination total="2"></sl-pagination> <br><br> <sl-pagination total="3" page="2"></sl-pagination> <br><br> <sl-pagination total="4" page="3"></sl-pagination> <br><br> <sl-pagination total="7" page="2"></sl-pagination> <br><br> <sl-pagination total="8" page="1"></sl-pagination> <br><br> <sl-pagination total="10" page="7"></sl-pagination> <br><br> <sl-pagination total="100" page="10"></sl-pagination> <br><br> <sl-pagination total="100" page="10" maximumButtons="10"></sl-pagination>
Importing
If you’re using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.
To import this component from the CDN using a script tag:
<script type="module" src="https://v2-48-10.yoummday-theme.pages.dev/components/pagination/pagination.js"></script>
To import this component from the CDN using a JavaScript import:
import 'https://v2-48-10.yoummday-theme.pages.dev/components/pagination/pagination.js';
To import this component using a bundler:
import '@yoummday/ymmd-shoelace/dist/components/pagination/pagination.js';
To import this component as a React component:
import SlPagination from '@yoummday/ymmd-shoelace/dist/react/pagination';
Properties
| Name | Description | Reflects | Type | Default |
|---|---|---|---|---|
page
|
The currently active page number |
number
|
1
|
|
total
|
The total number of pages |
number
|
0
|
|
maximumButtons
|
The maximum number of buttons to render. |
number
|
7
|
|
updateComplete |
A read-only promise that resolves when the component has finished updating. |
Learn more about attributes and properties.
Parts
| Name | Description |
|---|---|
base |
The button group |
Learn more about customizing CSS parts.
Dependencies
This component automatically imports the following dependencies.
<sl-button><sl-icon><sl-spinner>