Skip to main content
5.0.3Next5.0.35.0.25.0.15.0.04.0.94.0.84.0.73.2.03.1.03.0.13.0.02.1.12.0.101.0.0
Version: 5.0.3

Pagination

Pagination allows you to divide large amounts of content into smaller chunks across multiple pages. It's typically used in item listing or search results pages. They tell users how many pages of results have been found and allow users to navigate back and forth between them. Use pagination when the list becomes extensively long.

Basic Usage

<triton-pagination></triton-pagination>
<TritonPagination/>
<html> 
<head>
<script type="module">
import { defineCustomElements } from '~node_modules/@kognifai/triton-cl-core/loader/index.es2017.js';
defineCustomElements();
</script>
</head>
<body>
<triton-pagination></triton-pagination>
</body>
</html>

Behavior

Positioning

Use the position property to set the position of the pagination element.

<triton-pagination total="5" position="left"></triton-pagination>

Page Size

Use the page-size property to set the amount of data items to be included per pagintion page.

<triton-pagination total="10" page-size="3"></triton-pagination>

Settings

Total Items

Use the total property to set the total amount of data items. This will be used to calculate the amount of pages.

<triton-pagination total="15"></triton-pagination>

If the number of pages exceeds 7 then truncation will happen automatically.

<triton-pagination total="20" page-size="3"></triton-pagination>

Current Page

Use the current-page property to set which page is currently open.

<triton-pagination total="20" page-size="3" current-page="4"></triton-pagination>

Playground

API

Properties

PropertyDescriptionTypeDefault
current-pageSet the active pagenumber1
page-sizeSet the amount of data items to display on each pagenumber10
positionSet the alignment of the pagination componentPosition.CENTER Position.LEFT Position.RIGHTPosition.CENTER
sizeSet the size of the pagination buttonsbody small-
totalSet the total amount of data items included. This number is used to calculate the pages in the paginationnumber-

Events

NameTypeDescriptionExtra
atChangeCustomEvent<number>Emitted when the current page has changed-

Details

Depends on