lotusui the ikaito design language for Gio — desktop, mobile, web
GitHub

Pagination

Previous, next, numbered pages — long ranges elide around the current one.

Page is 1-based and lives on the struct; clicks are processed at the top of Layout, so the click's own frame renders the new page.

Installation

Use the module import (the default), or own the source: lotusui add vendors the component into your app and lotusui update keeps the copy mergeable — see Registry.

Go
go get github.com/ikaito-com/lotusui

# or vendor the source into your app:
go run github.com/ikaito-com/lotusui/cmd/lotusui add pagination

Usage

Go
var pg = lotusui.Pagination{Page: 1}
pg.Layout(th, gtx, 12) // 12 pages total
current := pg.Page

Simple

Simple renders numbered links only — no previous/next, no elision.

Go
pg := lotusui.Pagination{Simple: true}

Rows per page

The table toolbar: a Select for page size beside the pager — composition.

Go
rows := lotusui.Select{Options: []string{"10", "25", "50", "100"}, Selected: 1}

API

OptionTypeDescription
Pageint1-based current page — yours; clicks processed at the top of Layout.
totalintLayout parameter — total page count; long ranges elide.

Every demo on this site is the real Go component compiled to WebAssembly — one gallery app, one bundle, addressed by URL hash.