Pagination

Split data into pages and select the page number and item count.

Live preview
Interact with the component to see results here.
View code
HTML
<sy-pagination
  totalitems="123"
  pagesize="10"
  activepage="1"
  pagesizeoptions="10,20,50"
  total
></sy-pagination>

Usage guide

#

Use to browse many items in pages. The app handles actual data requests.

  1. Provide the total count

    totalItems is the item count, not the page count.

  2. Reflect the current page

    activePage starts at 1. Keep query results and page state synchronized.

  3. Fetch again on changes

    Fetch data using the new criteria in pageChanged and pageSizeChanged. The component does not make server requests for you.

Feature examples

#

Choose a feature from 12 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.

Usage examples · Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Property · Active Page

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Disabled

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Hideon Single

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Jumper

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Page Size Options

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Page Size

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Total Items

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Total

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Events · Page Changed

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

Events · Page Size Changed

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

Usage examples · Enter a page number

Enter the target page number. Out-of-range values are clamped to the first or last page.

View code
HTML
<sy-pagination
  totalitems="200"
  jumper
  total
></sy-pagination>

API reference

#

Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.

<sy-pagination>

Properties

Attribute / PropertyTypeDefaultDescription
number1Current page number, starting at 1.
booleanfalseBlock user interaction and keyboard focus.
booleanfalseHide controls when all data fits on one page.
booleanfalseShow an input for jumping to a page number.
number10Number of items shown per page.
stringundefinedComma-separated page-size options, such as 10,20,50.
booleanfalseShow the total item count.
number0Total number of data items.

Events

EventDetailDescription
CustomEvent<number>Read the result from the event's detail.
CustomEvent<number>Read the result from the event's detail.