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 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
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.
pg := lotusui.Pagination{Simple: true}
Rows per page
The table toolbar: a Select for page size beside the pager — composition.
rows := lotusui.Select{Options: []string{"10", "25", "50", "100"}, Selected: 1}
API
| Option | Type | Description |
|---|---|---|
Page | int | 1-based current page — yours; clicks processed at the top of Layout. |
total | int | Layout parameter — total page count; long ranges elide. |