Skip to content

Pagination ​

A minimal ‹ page / total › pager with clamped arrow buttons.

Examples ​

Current / total ​

moonbit
@sumi.pagination(
  page=current,
  total=4,
  on_change=set_page.map(v => _ => v),
)

API ​

pagination ​

NameTypeDefaultDescription
page *Int—Current page, 1-based (controlled)
total *Int—Total page count
on_changeEmit[Int]—Called with the clamped target page
idString—Element id
classString—Extra class names
attrsAttrs—Extra HTML attributes
styleArray[String][]Extra inline styles

* required (labelled) parameter — everything else is optional.