cnc-pagination
Previous and next controls with a "showing N to M of T" line. It tracks the current page and reports changes; fetching the page is the host's job.
Quick start
Give it the total count and a pagesize, and handle
change. The widget derives the page total and the info line itself, server-side
included.
Showing 1 to 10 of 94 results
page: 1
<cnc-pagination
count="94"
pagesize="10"
$currentpage="page"
@change="loadPage($event.detail.page)"
></cnc-pagination>
Usage guidance
count
is the TOTAL, not the page. Passing the length of the rows you currently hold gives one page and
a control that never moves — the widget cannot tell the difference, and this is the
mistake it makes easiest.
Fetch from change. The widget moves its own page number and the info line follows,
but the data behind it is untouched, so nothing loads without a handler.
It offers previous and next only — no page numbers, no jump-to-page, and no working page size selector. For a long list where the user needs to reach page 40, this is the wrong control and a search or filter is usually the better answer than a bigger pager.